Re: Cocoa Drawers Example
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.