Skip to content

Instantly share code, notes, and snippets.

@rentzsch
Created April 30, 2010 00:31
Show Gist options
  • Save rentzsch/384509 to your computer and use it in GitHub Desktop.
Save rentzsch/384509 to your computer and use it in GitHub Desktop.
NSPopUpButton *popup = NSToolbarSizeModeSmall == [toolbar sizeMode]
? [[[NSPopUpButton alloc] initWithFrame:NSMakeRect(0.0, 0.0, 40.0, 24.0)] autorelease]
: [[[NSPopUpButton alloc] initWithFrame:NSMakeRect(0.0, 0.0, 48.0, 32.0)] autorelease];
[[popup cell] setControlSize:NSSmallControlSize];
[popup setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
destinationPopup = [popup retain];
[result setView:popup]; [popup release];
// Eww, hard-coded size futzing:
NSSize size = [popup bounds].size;
size.width *= 3;
[result setMinSize:size];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment