mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-07 11:17:12 +00:00
Previously, when calling the method orderOut: on the full platform window of a CPPlatformWindow, cappuccino didn't close the parent CPPlatformWindow. When he does, this only works if the parent platformWindow is not the primary platform. Test app in Tests/Manual/CPPlatformWindow/
65 lines
1.7 KiB
Plaintext
65 lines
1.7 KiB
Plaintext
/*
|
|
* AppController.j
|
|
* CPPlatformWindow
|
|
*
|
|
* Created by You on October 30, 2014.
|
|
* Copyright 2014, Your Company All rights reserved.
|
|
*/
|
|
|
|
@import <Foundation/Foundation.j>
|
|
@import <AppKit/AppKit.j>
|
|
|
|
|
|
@implementation AppController : CPObject
|
|
{
|
|
@outlet CPWindow theWindow;
|
|
@outlet CPWindow windowPlatformWindow;
|
|
|
|
CPPlatformWindow platformWindow;
|
|
|
|
}
|
|
|
|
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
|
{
|
|
// This is called when the application is done loading.
|
|
|
|
platformWindow = [[CPPlatformWindow alloc] init];
|
|
[platformWindow setContentRect:[windowPlatformWindow contentRectForFrameRect:[windowPlatformWindow frame]]];
|
|
|
|
[windowPlatformWindow setPlatformWindow:platformWindow];
|
|
[windowPlatformWindow setFullPlatformWindow:YES]
|
|
}
|
|
|
|
- (void)awakeFromCib
|
|
{
|
|
// This is called when the cib is done loading.
|
|
// You can implement this method on any object instantiated from a Cib.
|
|
// It's a useful hook for setting up current UI values, and other things.
|
|
|
|
// In this case, we want the window from Cib to become our full browser window
|
|
[theWindow setFullPlatformWindow:YES];
|
|
}
|
|
|
|
- (IBAction)showWindow:(id)sender
|
|
{
|
|
[windowPlatformWindow orderFront:sender];
|
|
}
|
|
|
|
- (IBAction)closeWindow:(id)sender
|
|
{
|
|
[windowPlatformWindow orderOut:sender];
|
|
}
|
|
|
|
- (IBAction)changeFrame:(id)sender
|
|
{
|
|
[platformWindow setContentRect:CGRectMake(50, 50, 200, 200)];
|
|
}
|
|
|
|
- (IBAction)showAlert:(id)sender
|
|
{
|
|
var alert = [CPAlert alertWithMessageText:@"rer" defaultButton:"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:"Multiple login failures may result in blocked access to the system."];
|
|
[alert beginSheetModalForWindow:windowPlatformWindow];
|
|
}
|
|
|
|
@end
|