• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Need some more understanding about NSDrawer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Need some more understanding about NSDrawer
      • From: Bill Bumgarner <email@hidden>
  • Prev by Date: Re: how to know when a thread is done setting up
  • Next by Date: Re: Adding Help to App
  • Previous by thread: Re: how to know when a thread is done setting up
  • Next by thread: Re: Need some more understanding about NSDrawer
  • Index(es):
    • Date
    • Thread