Skip to content

Instantly share code, notes, and snippets.

@jerodsanto
Created December 29, 2009 17:02
Show Gist options
  • Save jerodsanto/265428 to your computer and use it in GitHub Desktop.
Save jerodsanto/265428 to your computer and use it in GitHub Desktop.
CPPopUpButton as select box
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView];
var dropdown = [[CPPopUpButton alloc] initWithFrame:CGRectMake(100,100,140,24)];
[dropdown addItemsWithTitles:['Genre','Drama', 'Comedy', 'Action']];
[contentView addSubview:dropdown];
[theWindow orderFront:self];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment