Re: [Gtk-osx-users] Quit while within the Quit handler



On Aug 25, 2010, at 3:17 PM, Phillip Heller wrote:

> Greetings,
> 
>  I've connected NSApplicationBlockTermination to a handler (sig_close).  Works great!
> 
> However, when I'm in that handler, if I hit CMD-Q, the application exits immediately.
> 
> Is there a way to disable Quit command, such that I might disable it while in this sig_close handler?
> 

void gtk_osxapplication_set_use_quartz_accelerators(GtkOSXApplication *self, 
					 gboolean use_quartz_accelerators);

Call it with FALSE and your Gtk+ code will be in complete control of the accelerators -- meaning that they won't be passed to NSApplication for keyEquivalent processing at all. Finer grained control would require that you customize static GdkFilterReturn GtkOSXApplication::global_event_filter_func() or add your own filter ahead of it.

Regards,
John Ralls






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