NSPopUpButton with images
NSPopUpButton with images
- Subject: NSPopUpButton with images
- From: Gideon King <email@hidden>
- Date: Thu, 2 May 2002 21:26:35 +0800
I am wanting to implement a pop up button with images as the items. I
have programmatically created the menu and added the items with the
images on them. The images are taller than the standard popup button
size. They work fine with the exception that whatever I do, I can't make
the button taller than the standard height (the popup items are the
right height when popped up).
This is the same behaviour seen in the MenuMadness example.
Does anyone know of a way of increasing the height of the NSPopUpButton?
NSRect rect;
NSPopUpButton *pub;
NSMenuItem *item;
rect = NSMakeRect(20,20, 50, 50);
pub = [[NSPopUpButton alloc] initWithFrame:rect pullsDown:NO];
[pub addItemWithTitle:@""];
item = [pub itemAtIndex:0];
[item setImage:[NSImage imageNamed:@"tAssistanceOn"]];
[pub addItemWithTitle:@""];
item = [pub itemAtIndex:1];
[item setImage:[NSImage imageNamed:@"tAssistanceOff"]];
[pub sizeToFit]; // This adjusts the width but not the height.
TIA
Gideon.
_______________________________________________
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.