@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@class SomeViewSubclass;
@implementation AppController : CPObject
{
@outlet CPWindow theWindow;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// This is called when the application is done loading.
}
- (void)awakeFromCib
{
// This is called when the cib is done loading.
// You can implement this method on any object instantiated from a Cib.
// It's a useful hook for setting up current UI values, and other things.
// In this case, we want the window from Cib to become our full browser window
[theWindow setFullPlatformWindow:NO];
var aView = [[SomeViewSubclass alloc] initWithFrame:CGRectMake(10, 10, 50, 50)];
[aView setBackgroundColor:[CPColor redColor]];
[[theWindow contentView] addSubview:aView];
var anotherView = [[CPView alloc] initWithFrame:CGRectMake(10, 10, 30, 30)];
[anotherView setBackgroundColor:[CPColor greenColor]];
[aView addSubview:anotherView];
}
@end
@implementation SomeViewSubclass : CPView
{
}
- (void)mouseEntered:(CPEvent)anEvent
{
CPLog.trace("mouseEntered");
}
@end