import @implementation AppController : CPObject { } - (void)applicationDidFinishLaunching:(CPNotification)aNotification { var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask], contentView = [theWindow contentView]; [theWindow orderFront:self]; var bounds = [contentView bounds], loginWidth = 400, loginHeight = 200; var HUDPanel = [[CPPanel alloc] initWithContentRect:CGRectMake((CGRectGetWidth(bounds) / 2.0) - (loginWidth/2.0), (CGRectGetHeight(bounds)/2.0-(loginHeight/2.0)), loginWidth, loginHeight) styleMask:CPHUDBackgroundWindowMask]; [HUDPanel setFloatingPanel:YES]; [HUDPanel setTitle:"Login"]; [HUDPanel orderFront:self]; var panelContentView = [HUDPanel contentView], textField = [[CPTextField alloc] initWithFrame:CGRectMake(0,0,150,22)]; [textField setBackgroundColor:[CPColor whiteColor]]; [textField becomeFirstResponder]; [textField setEditable:YES]; [textField setTarget:self]; [textField setAction:@selector(search:)]; [panelContentView addSubview:textField]; } - (void)search:(CPTextField)aText { alert([aText stringValue]); } @end