discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: no close button


From: Germán Arias
Subject: Re: no close button
Date: Fri, 23 Mar 2012 16:56:05 -0600
User-agent: GNUMail (Version 1.2.0)

On 2012-03-23 14:34:06 -0600 Ivan Vučica <address@hidden> wrote:
> 
> I'm not sure why this is necessary. NSWindow already has a flag which
> explicitly must be set to make the window closable. Why would this be
> theme's choice?
> 
> The already-implemented NSApplicationDelegate
> method, 
> -(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication;,
> is the right approach to understand whether closing the application's
> window means that app needs to terminate as well.
> 
> What if the app is actually multiwindow, but not NSDocument-based? What if
> it opens windows dynamically? How will you decide whether the close button
> should be available, in case a theme for some weird reason says "no,
> please, don't add a close button"?
> By applicationShouldTerminateAfterLastWindowClosed returning "yes" and the
> window being the last one?  Isn't that a hacky?
> 
> Especially in the context of a NeXT-style dock, terminating the app when
> the last window closes is anything but wrong. What is the worst thing that
> happens? That the floating, NeXT-style main menu disappears? If that's a
> problem, the app should be solving it by not returning YES
> in applicationShouldTerminateAfterLastWindowClosed. If it really turns out
> to be a problem that an app should not solve, GNUstep could ignore the
> result of applicationShouldTerminateAfterLastWindowClosed in case a
> floating NeXT menu is used.
> 
> But otherwise -- why not simply honor the flag set for the NSWindow? :-)
> 

Had not understood your idea with the method 
-applicationShouldTerminateAfterLastWindowClosed:. Now I understand your point.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]