Re: Object Layering is Changing When Calling -addSubview:
Re: Object Layering is Changing When Calling -addSubview:
- Subject: Re: Object Layering is Changing When Calling -addSubview:
- From: "I. Savant" <email@hidden>
- Date: Sat, 2 Sep 2006 12:27:18 -0400
If you search the archives for similar situations, you'll find
many replies stating that you should not overlap sibling views in
this way as the results are unpredictable.
I would suggest subclassing NSView and compositing your gradient
in the -drawRect: method. Then make the buttons a subview of your
gradient view.
--
I.S.
On Sep 2, 2006, at 12:14 PM, Dave Batton wrote:
I wanted a gradient behind some buttons. So I placed an NSImageView
in my window to display a 1 pixel wide tiff scaled to fit across
the window. Then I placed some NSButtons on top of it. That worked
great.
Now my design has become a little more complex, so now in my window
I have a Custom NSView there, and I've moved the previous contents
to a separate view. At runtime I move the separate view into the
window using -addSubview:. That works great too, _except_ that the
NSView is now drawn in front of the buttons. I can tell because if
I move the background object a little I can clearly see the active
buttons behind it. I've double checked the layering of the objects
in the view, and the buttons are in front of the NSImageView. And
the NSImageView is inactive, and the buttons are active.
How can I force the buttons to be drawn on top of the NSImageView
object?
--
Dave Batton
Mere Mortal Software
http://www.Mere-Mortal-Software.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden