Re: [gtk-osx-users] [Gtk-osx-users] GTK osx apps and iconification

On Mar 9, 2017, at 4:09 AM, Gabriele Greco <gabrielegreco gmail com> 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);

... 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 

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.

John Ralls

Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
Gtk-osx-users mailing list
Gtk-osx-users lists sourceforge net

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