Some problems appearing on porting to Mac.
Submitted by Brüggemann
Assigned to gtk-quartz maintainers
Link to original bug (#789496)
Description
Hi to everybody,
I want to discuss about Gtk-3 Mac integration.
Menu bar
At first let discuss about the menu bar:
I can easily display a menu bar using:
.. code-block:: C
void gtkosx_application_set_menu_bar(GtkosxApplication *self, GtkMenuShell *menu_shell);
void gtkosx_application_sync_menubar(GtkosxApplication *self);
But the shortcuts are not displayed into the menubar using the 2 first functions.
And the radio buttons are not updated (the checkbox stay at the same place) when you choose another that the one defined per default.
I have defined a type named GTK_SMART_MENU_ITEM
which you can see here: https://github.com/mrcyberfighter/gfast-copy/blob/master/gfast-copy-1.0/src/GtkSmartMenuItem.c.
I think I don't do it right because I don't use, because I don't have understand, the following functions:
.. code-block:: C
void gtkosx_application_insert_app_menu_item(GtkosxApplication *self, GtkWidget *menu_item, gint index);
void gtkosx_application_set_window_menu(GtkosxApplication *self, GtkMenuItem *menu_item);
void gtkosx_application_set_help_menu(GtkosxApplication *self, GtkMenuItem *menu_item);
- The first
gtkosx_application_insert_app_menu_item(...)
you must add a widget and an index.
Must I start the index at 0 per every GtkMenu or what's about this function.
And how bind a GtkMenu to a GtkMenuItem on Mac with this ?
Will it work right after using gtkosx_application_insert_app_menu_item(...)
?
For AccelLabels displaying and updating the radio buttons ?
I could embed this function into my code but I must know how.
- The 2 last functions I don't have understand it at all.
Open files
By the way when you define a GtkApplication opening files doesn't work at all
using the "open" signal:
.. code-block:: C
The “open” signal
void user_function (GApplication *application, gpointer files, gint n_files, gchar *hint, gpointer user_data)
The "open" signal is emitted on the primary instance when there are files to open. See g_application_open() for more information.
GtkFileChooserNative
I have intercept (view on the Web) that the GtkFileChooserNative should work on
MacOSX displaying a native Mac file chooser.
But into my tries it display an abnormal GNU/Linux File chooser.
What's about ?
Packaging
As long as I talk with MacOSX geeks I can't build a packages for Mac.
Because I failed to relocated the libraries getting from brew concerning Gtk+-3.0 into others using install_name_tool
.
The best I can do Is to provide an entry into the /Applications folder using the autotools.
I had the worse idea to create a *.pkg package and to copy the dependencies (identify with otool),
into their original folder and to provide the /Applications menu entry.
But with brew it's a hell of symlinks and I don't have the courage to do it.
Does nobody get a script using otool and install_name_tool for relocating the libraries
into an /Application/my_app.app package ?
Gtk Notifications
Doesn't work at all nor on Mac neither on Windows.
Final word
P.S: I open a lot of problems relying on Gtk-3 I don't want to insult anyone, I don't criticize, nobody is perfect.
But for some of the problems it have maybe an answers ?
Gtk is the best G.U.I for GNU/Linux but is less popular than Qt and less portable.