Re: [Gtk-osx-users] pygtk and NSApplicationBlockTermination
- From: John Ralls <jralls ceridwen fremont ca us>
- To: GTK+-2 OSX Users <gtk-osx-users lists sourceforge net>
- Subject: Re: [Gtk-osx-users] pygtk and NSApplicationBlockTermination
- Date: Tue, 24 Aug 2010 16:50:43 -0700
On Aug 24, 2010, at 2:30 PM, Phillip Heller wrote:
> Well, I've resolved #1 on my own. It seems that a thread within the client was hanging around, though only when quit was invoked via integration (weird!).
>
> However, I'm then unsure how the Application "Quit" entry is integrated without me specifying which callback to use....
>
>>From the GtkOSXApplication documentation:
> Signal Details
>
> The "NSApplicationBlockTermination" signal
>
> gboolean user_function (GtkOSXApplication *app,
> gpointer user_data): No Recursion / Action
>
> Emitted by the Application Delegate when the application reeeives an NSApplicationShouldTerminate notification. Perform any cleanup you need to do (e.g., saving files) before exiting. Returning FALSE will allow further handlers to run and if none return TRUE, the application to shut down. Returning TRUE will veto shutdown and stop emission, so later handlers will not run.
>
> app : The application object
> user_data : Data appended at connection
> user_data : user data set when the signal handler was connected.
> Returns : Boolean indicating that further emission and application termination should be blocked.
and
> The "NSApplicationWillTerminate" signal
>
> void user_function (GtkOSXApplication *app,
> gpointer user_data): No Recursion / Action
>
> Emitted by the Application Delegate when the application reeeives an NSApplicationSWillTerminate notification. Connect your final shutdown routine (the one that calls gtk_main_quit() here.
>
> app : The application object
> user_data : Data appended at connection
> user_data : user data set when the signal handler was connected.
In the absence of a handler for NSApplicationWillTerminate, OSX will just kill the process and reclaim its resources.
A very simple example is included in src/test-integration.c.
Regards,
John Ralls
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]