mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 13:07:02 +00:00
- Factored out blur handler from CPTokenField into CPTextField. - CPTextField will no longer lose focus unnecessarily. - Changed switch style in CPWindow -sendEvent. - Added menu bar to KeyViewLoop test app.
43 lines
729 B
Plaintext
43 lines
729 B
Plaintext
/*
|
|
* AppController.j
|
|
* KeyViewLoopTest
|
|
*
|
|
* Created by You on January 7, 2013.
|
|
* Copyright 2013, Your Company All rights reserved.
|
|
*/
|
|
|
|
@import <Foundation/CPObject.j>
|
|
|
|
|
|
@implementation AppController : CPObject
|
|
{
|
|
@outlet CPWindow keyWindow;
|
|
}
|
|
|
|
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
|
{
|
|
[keyWindow makeKeyAndOrderFront:self];
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
@implementation MyWindow : CPWindow
|
|
|
|
- (@action)addField:(id)sender
|
|
{
|
|
var field = [CPTextField textFieldWithStringValue:@"" placeholder:@"" width:96];
|
|
|
|
[field setFrameOrigin:CGPointMake(20, 120)];
|
|
[[self contentView] addSubview:field];
|
|
|
|
[sender setEnabled:NO];
|
|
}
|
|
|
|
- (@action)recalc:(id)sender
|
|
{
|
|
[self recalculateKeyViewLoop];
|
|
}
|
|
|
|
@end
|