Need some more understanding about NSDrawer
Need some more understanding about NSDrawer
- Subject: Need some more understanding about NSDrawer
- From: Craig Laird <email@hidden>
- Date: Mon, 25 Dec 2006 19:58:28 +1100
Hi all
I am a newbie to Cocoa, so I hope I ask my question right.
I have a custom toolbar that toggles a NSDrawer and it opens and
close fine on
the left edge. I set the Preferred Edge to the right but it will
open on the left.
When testing how you toggle a NSDrawer I used a button. The button
when set to
toggle and the Preferred Edge is set to right work great , and also
when the window
is to close to the right side of the screen open on the left. This
is fantastic :)
My question is how can I get my toolbar to do the same as the way
the button works.
Here is the code that I am using
- (void)setupDrawer {
[drawer setMinContentSize:NSMakeSize(100, 100)];
[drawer setMaxContentSize:NSMakeSize(400, 400)];
}
- (void)toggleDrawer:(id)sender {
NSDrawerState state = [drawer state];
if (NSDrawerOpeningState == state || NSDrawerOpenState == state) {
[drawer close];
} else {
[drawer openOnEdge:NSMinXEdge];
}
}
I have tried to find information on this without much luck.
I am hoping that someone out there can show my some sample code or
even better
a small app the will show how you get a drawer to toggle open and
close without using a
Interface Builder button.
Cheers
Craig
_______________________________________________
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