Files
cappuccino/Tests/Manual/KeyViewLoopTest/AppController.j
T
Aparajita Fishman b59f96d238 Key view loop enhancements...
- Nested views are now handled recursively as they are in Cocoa.
- Added a nested view test in the test app.
2013-01-10 21:49:54 +07:00

45 lines
861 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];
[self makeFirstResponder:[[self contentView] viewWithTag:1]];
}
- (@action)recalc:(id)sender
{
[self recalculateKeyViewLoop];
[self makeFirstResponder:[[self contentView] viewWithTag:1]];
}
@end