• 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
Re: Cocoa Drawers Example
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa Drawers Example


  • Subject: Re: Cocoa Drawers Example
  • From: Tom Waters <email@hidden>
  • Date: Wed, 6 Jun 2001 13:49:47 -0700

There really isn't much in the way of code for drawers. You make a window with a drawer in IB, and connect it up to your outlets. Throw another view in the drawer and deal with it just like you would if it was in a window.

In order to open and close it, put this in your document subclass, or app delegate, and hook it up to buttons, menu items, and toolbar items...

// uses IBOutlet id drawer; // hooked up in IB
- (void)toggleDrawer:(id)sender
{
if ([sender class] == [NSMenuItem class]) {
id oc = [drawer state] == NSDrawerOpenState ? @"Show" : @"Hide";
[sender setTitle: [oc stringByAppendingString: @" Drawer"]];
}
[drawer toggle: sender];
}

hope this helps. (I assumed that you understand the mechanics of IB and outlet connections, because if you don't yet, drawers probably aren't the place to learn them.)

On Tuesday, June 5, 2001, at 02:34 PM, Prem Chopra wrote:

Does anybody have source code examples of using drawers. None of the examples
included with the developer CD have such examples, nor could I find one online.
I don't think Vermont Recipes at the point of talking about drawers.


  • Follow-Ups:
    • Re: Cocoa Drawers Example
      • From: Scott Anguish <email@hidden>
References: 
 >Cocoa Drawers Example (From: Prem Chopra <email@hidden>)

  • Prev by Date: Re: TIFF's w/ alpha channels
  • Next by Date: Re: Fear
  • Previous by thread: Re: Cocoa Drawers Example
  • Next by thread: Re: Cocoa Drawers Example
  • Index(es):
    • Date
    • Thread