Re: Auto-opening a Drawer
Re: Auto-opening a Drawer
- Subject: Re: Auto-opening a Drawer
- From: Glen Simmons <email@hidden>
- Date: Fri, 13 Jul 2001 11:54:30 -0500
I poked at this for a while before stumbling over one solution: put the
[myDrawer open] in a delegate method that gets called later. My drawer
is attached to a main window, so I put [myDrawer open] in
applicationDidFinishLaunching.
I would speculate that since awakeFromNib gets called once for each
object that gets instantiated, all the pieces and parts (window, drawer,
content view) aren't there when you call open.
Glen
On Friday, July 13, 2001, at 12:31 AM, Charles Jolley wrote:
Thanks Peter! This worked very well! It also provides a nice effect
since my window is first displayed and then the drawer opens. Easy and
nice looking!
Cheers,
-Charles
PS. Does anyone know if this is the way the API is supposed to work?
Shouldn't I just be able to send [myDrawer open] from awakeFromNib: (or
some such method) and have it open at the right time? If that is the
intended operation, then this is a bug...
On Thursday, July 12, 2001, at 11:39 PM, Peter Ammon wrote:
On Thursday, July 12, 2001, at 01:35 PM, Charles Jolley wrote:
Hello Cocoa Afscinandos:
I know this is simple, but I can't seem to get it to work. I
have an NSDrawer attached to a window that I want to have open
automatically when the window is created. I am using NSDocument and
the default NSWindowController instances.
I have tried sending [(NSDrawer instance) open] in
windowControllerDidLoadNib: in NSDocument and awakeFromNib: in
NSDocument. The result is that the NSDrawer thinks it is open, but
does not actually display itself.
Where do I put this call?
The solution I use is to just create a timer in my awakeFromNib
method. I'm sure you could put it lots of other places.
[NSTimer scheduledTimerWithTimeInterval:0
target:myDrawer
selector:@selector(open:)
userInfo:nil
repeats:NO];
Hope this helps.
-Peter
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev