Files
cappuccino/Tests/Manual/CPSegmentedControlBindings/AppController.j
T
cacaodevandAparajita Fishman 72c277d9ee New: CPSegmentedControl segment selection bindings support
This commit adds support for the segment selection bindings: selectedIndex, selectedLabel, and selectedTag.

Sample app included.
2013-03-08 08:54:00 -05:00

40 lines
805 B
Plaintext

/*
* AppController.j
* CPSegmentedControlBindings
*
* Created by You on November 24, 2012.
* Copyright 2012, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
CPWindow theWindow; //this "outlet" is connected automatically by the Cib
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
}
- (void)awakeFromCib
{
[theWindow setFullPlatformWindow:YES];
}
@end
@implementation ArrayController : CPArrayController
{
}
- (id)newObject
{
var randIndex = FLOOR(RAND()*3),
randLabel = ["un", "deux", "trois", nil][FLOOR(RAND()*4)],
randTag = FLOOR(RAND()*3);
return [CPDictionary dictionaryWithObjectsAndKeys:randIndex, @"index", randLabel, @"label", randTag, @"tag"];
}
@end