mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-27 05:57:04 +00:00
Issue#2406 reported a behavior different from Cocoa Framework. This test validates that Cappuccino CPSplitView is working well when adding and removing a subview. A CPSplitView that has only one subview should resize it to take the whole space available. This PR adds a new test to Tests/Manual
48 lines
972 B
Plaintext
48 lines
972 B
Plaintext
/*
|
|
* AppController.j
|
|
* CPSplitViewDivider
|
|
*
|
|
* Created by You on January 12, 2016.
|
|
* Copyright 2016, Your Company All rights reserved.
|
|
*/
|
|
|
|
@import <Foundation/Foundation.j>
|
|
@import <AppKit/AppKit.j>
|
|
|
|
|
|
@implementation AppController : CPObject
|
|
{
|
|
@outlet CPSplitView splitView;
|
|
@outlet CPView viewLeft;
|
|
@outlet CPView viewRight;
|
|
@outlet CPWindow theWindow;
|
|
}
|
|
|
|
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
|
{
|
|
}
|
|
|
|
- (void)awakeFromCib
|
|
{
|
|
[theWindow setFullPlatformWindow:YES];
|
|
[viewLeft setBackgroundColor:[CPColor grayColor]];
|
|
[viewRight setBackgroundColor:[CPColor greenColor]];
|
|
}
|
|
|
|
- (@action)clickChangeButton:(id)aSender
|
|
{
|
|
if (![viewRight superview])
|
|
{
|
|
console.log(@"Add viewRight in splitView");
|
|
[splitView addSubview:viewRight];
|
|
}
|
|
else
|
|
{
|
|
console.error(@"Remove viewRight from splitView");
|
|
[viewRight removeFromSuperview];
|
|
}
|
|
}
|
|
|
|
|
|
@end
|