Re: Multiple Overlapping SubViews?
Re: Multiple Overlapping SubViews?
- Subject: Re: Multiple Overlapping SubViews?
- From: Buddy Kurz <email@hidden>
- Date: Mon, 15 Dec 2003 15:11:37 -0800
On Dec 15, 2003, at 11:36 AM, John Rieffel wrote:
Not exactly. In all likelihood, the view is being displayed, and
then the
second view is being displayed on top of it with an opaque background.
This is not the case - each of my views fills itself with clearColor
in its
drawRect: method.
If you are using it, NSRectFill() doesn't support alpha.
You could use [[NSBezierPath bezierPathWithRect:myRect] fill] instead
to get a clear fill.
Also, I think your views should be subviews of each other.
[[yourWindow contentView] addSubview:yourSubview1];
[yourSubview1 addSubview:yourSubview2];
[yourSubview2 addSubview:yourSubview3];
buddy
This does sound strange. What effect are you trying to achieve,
exactly?
I have an NSScrollView subclass that draws an oscillogram (x-y plot of
sound data). I have two other types of data that I want to display on
the same axes, but that aren't sound data or even related to the sound.
One option of course is to make each type of view a subclass of the
other, and have each drawRect call [super drawRect], but this is
suboptimal because the the class hierarchy would impose a logical
relationship that doesn't exist:
NSScrollview->mySoundData->myOtherData1->myOtherData2.
Much better, rather, to have an NSScrollView that independently
contains
all three, don't you think?
NSScrollView
/ | \
mySndData myData1 myData2
where each could be independently updated if necessary.
The third option, which is my current poor solution, is to create
separate overaly windows for myData1 and myData2, and always make them
aware for mySndData's documentVisibleRect, so that they know what
portion of their own document view to display.
jr
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.