Re: Changing order of views dynamically
Re: Changing order of views dynamically
- Subject: Re: Changing order of views dynamically
- From: Michael Watson <email@hidden>
- Date: Mon, 19 Mar 2007 05:15:04 -0400
Views aren't like windows in Cocoa. That's the short answer.
The long answer is that windows can be overlapped, but views cannot
be overlapped reliably; views are /nested/ instead. Whatever it is
that you're doing, don't rely on the order in which your views are
added to a hierarchy, and don't overlap views. Nest them instead.
--
m-s
On 19 Mar, 2007, at 04:23, Sergey Shapovalov wrote:
Hello all!
I'm trying to figure out if there's a way to change the order of
views in a window dynamically.
When I create a window, I can set its order relatively to another
window by calling [NSWindow addChildWindow:ordered:]. At run-time,
I can change the windows z-order by calling [NSWindow orderBack:],
[NSWindow orderFront:], or [NSWindow orderWindow:relativeTo:].
With views, I can set their order at the moment of creation by
calling [NSView addSubview:positioned:relativeTo:]. But I can't
find a function to change the order of views at run-time. Am I just
blind for not seeing the proper method, :) or is this task more
complicated and it doesn't imply just one line of the code? If so,
can anybody drop me a hint concerning how this can be done?
Best regards,
Sergey Shapovalov.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
40bungie.org
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden