Re: [Gtk-osx-users] [gtk-osx-users] GTK osx apps and iconification
Status: Beta
Brought to you by:
jralls
From: John R. <jr...@ce...> - 2017-03-09 15:18:59
|
> On Mar 9, 2017, at 4:09 AM, Gabriele Greco <gab...@gm...> wrote: > > Hi guys, > > I've found that I have to add to my GTK+2 OSX apps the following code: > > #ifdef __APPLE__ > GtkosxApplication *theApp = (GtkosxApplication *)g_object_new(GTKOSX_TYPE_APPLICATION, NULL); > g_signal_connect(theApp, "NSApplicationWillTerminate", G_CALLBACK(g_main_quit), NULL); > gtkosx_application_ready(theApp); > #endif > > ... to respond correctly to an un-iconify OSX signal (click on the dock icon) or to the right click on icon "exit signal" > > Is this necessary or, provided I don't need a menu, there are other crossplatform ways to avoid these problems? > That looks correct to me. It's not a problem to have special code for different platforms: It's more of a fact of life in cross-platform programming with Gnome libraries. If that really bugs you, you can port your program to Qt, which AFAIK requires no special per-platform code. I don't know of any other library that provides mac integration for Gtk2. Regards, John Ralls |