mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-27 05:57:04 +00:00
This could cause memory leaks and was unnecessarily verbose. CPPopUpButton , CPRadio and CPSegmentedControl now use a generic CPBinder method for searching the binder involved when the control is asked to reverse set the binding, typically after a user interaction. Fixes #2199 TODO: prevent user to bind multiple selection bindings when these bindings are exclusive.
42 lines
839 B
Plaintext
42 lines
839 B
Plaintext
/*
|
|
* AppController.j
|
|
* CPSegmentedControlBindings
|
|
*
|
|
* Created by You on November 24, 2012.
|
|
* Copyright 2012, Your Company All rights reserved.
|
|
*/
|
|
|
|
CPLogRegister(CPLogConsole)
|
|
|
|
@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 = ["Label1", "Label2", "Label3", nil][FLOOR(RAND() * 4)],
|
|
randTag = FLOOR(RAND() * 3);
|
|
|
|
return [CPDictionary dictionaryWithObjectsAndKeys:randIndex, @"index", randLabel, @"label", randTag, @"tag"];
|
|
}
|
|
|
|
@end |