Skip to content

Instantly share code, notes, and snippets.

@saikat
Created November 1, 2009 00:08
Show Gist options
  • Select an option

  • Save saikat/223321 to your computer and use it in GitHub Desktop.

Select an option

Save saikat/223321 to your computer and use it in GitHub Desktop.
/*
* AppController.j
* TestText
*
* Created by You on October 30, 2009.
* Copyright 2009, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView];
var label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()];
[label setSecure:YES];
[label setEditable:YES];
[label setStringValue:@"test"];
[label setFont:[CPFont fontWithName:"Helvetica" size:12]];
[label sizeToFit];
[label setFrameSize:CGSizeMake(100, [label frame].size.height)];
[label setBackgroundColor:[CPColor yellowColor]];
[label setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin];
[label setCenter:[contentView center]];
[contentView addSubview:label];
[theWindow orderFront:self];
// Uncomment the following line to turn on the standard menu bar.
//[CPMenu setMenuBarVisible:YES];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment