Minimize terminates application
Minimize terminates application
- Subject: Minimize terminates application
- From: Paul Roebuck <email@hidden>
- Date: Mon, 30 Jan 2006 13:02:33 -0600
Wrote a small WebKit application to handle my VPN connection.
Overall, it works great with one exception: minimizing the
single window causes the application to terminate. Attempted
running under the debugger but saw nothing that helped me
understand why this occurs.
Can someone explain (in simple terms) why pressing the yellow
window control triggers the
applicationShouldTerminateAfterLastWindowClosed method as
I don't understand why it's being invoked. How do I prevent
application termination when minimizing my single window?
Desired behavior would be the same as that of OmniDictionary.
TIA
---------------- source if it matters ------
#import "MyController.h"
#import <WebKit/WebKit.h>
@implementation MyController
//
-----------------------------------------------------------------------------
// Loads the URL into the application's WebKit view
//
-----------------------------------------------------------------------------
- (void)loadURL:(NSURL *) URL
{
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:URL]];
}
//
-----------------------------------------------------------------------------
// Loads the login webpage once application is started
//
-----------------------------------------------------------------------------
- (void)awakeFromNib
{
[NSApp setDelegate:self];
// Load a default URL into WebKit view
NSURL *URL = [NSURL URLWithString:@"http://127.0.0.1:9161/eac.cgi"];
[self loadURL:URL];
}
//
-----------------------------------------------------------------------------
// Displays the URL in the default web browser
//
-----------------------------------------------------------------------------
- (void)openWebPage:(NSURL *) URL
{
[[NSWorkspace sharedWorkspace] openURL:URL];
}
//
-----------------------------------------------------------------------------
// Display help in web browser when help menu item selected
//
-----------------------------------------------------------------------------
- (void)showHelp:(id)sender
{
NSURL *URL = [NSURL
URLWithString:@"file://localhost/private/etc/netlock/help/contents.htm"];
[self openWebPage:URL];
}
//
-----------------------------------------------------------------------------
// Terminate the program when the last window closes
//
-----------------------------------------------------------------------------
-
(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication
*) theApplication
{
return YES;
}
@end
--
----------------------------------------------------------
Out of the 10Base-T, through the router, down the T1, over the
leased line, off the bridge, past the firewall... nothing but Net.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden