Re: toolbars
Re: toolbars
- Subject: Re: toolbars
- From: j o a r <email@hidden>
- Date: Thu, 4 Apr 2002 07:22:08 +0200
On Thursday, April 4, 2002, at 04:05 , Matthew Johnson wrote:
This bit of code will add a space and a label for me in a tool bar. But
how do I get the actual menu to show up?
RTFM - and the example code that is installed with your development
tools - but basically this is what you need to add to what you already
have:
// Don't just alloc the pop up button- you need to init too!
// Something like this. I haven't tried to compile it so there might be
slight
// problems with this code, but it should be basically OK:
popUpButton = [[NSPopUpButton alloc] initWithFrame:NSZeroRect];
[popUpButton insertItemWithTitle:[NSString stringWithCString:cStr]
atIndex:0];
[popUpButton sizeToFit];
// And then, besides what you've already done to create the toolbar
item, add:
[item setView:popUpButton];
[item setMinSize:[popUpButton frame].size];
[item setMaxSize:[popUpButton frame].size];
j o a r
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >toolbars (From: Matthew Johnson <email@hidden>) |