Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import <Foundation/CPObject.j>
- import <AppKit/CPPanel.j>
- import <AppKit/CPWindowController.j>
- @implementation ColorWindow : CPWindowController
- {
- }
- - (id)init
- {
- var hud = [[CPPanel alloc]
- initWithContentRect:CGRectMake(100,100,225,125)
- styleMask: nil];
- self = [super initWithWindow:hud];
- if (self)
- {
- [hud setFloatingPanel:YES];
- [hud orderFront:self];
- var cv = [[self window] contentView];
- [cv setBackgroundColor:[CPColor whiteColor]];
- }
- return self;
- }
- - (void)setBackgroundColor:(CPColor)color
- {
- var cv = [[self window] contentView];
- [cv setBackgroundColor:color];
- }
- @end
- @implementation AppController : CPObject
- {
- }
- - (void)applicationDidFinishLaunching:(CPNotification)aNotification
- {
- var win = [[CPWindow alloc]
- initWithContentRect:CGRectMakeZero()
- styleMask:CPBorderlessBridgeWindowMask];
- contentView = [win contentView];
- [win orderFront:self];
- [contentView setBackgroundColor:[CPColor blackColor]];
- var lwin = [[ColorWindow alloc] init];
- [lwin showWindow:self];
- [lwin setBackgroundColor:blueColor];
- }
- @end
Add Comment
Please, Sign In to add comment