After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 789496 - Some problems appearing on porting to Mac.
Some problems appearing on porting to Mac.
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Backend: Quartz
unspecified
Other Mac OS
: Normal enhancement
: ---
Assigned To: gtk-quartz maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-10-25 22:18 UTC by Brüggemann
Modified: 2018-05-02 19:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Brüggemann 2017-10-25 22:18:37 UTC
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.
Comment 1 John Ralls 2017-10-26 20:06:45 UTC
GtkosxApplication is completely separate from GtkApplication. You can't mix them. GtkosxApplication is part of GtkOSX, for support please join gtk-osx-users@lists.gnome.org and ask there after studying https://wiki.gnome.org/Projects/GTK%2B/OSX/Integration and the example/test program in gtk-mac-integration/src.

If you want to use GApplication then to get Mac menu integration you must replace your GtkMenu implementation with GMenuModel.

The GtkOSX project includes gtk-mac-bundler, see https://wiki.gnome.org/Projects/GTK%2B/OSX/Bundling
It should work regardless of which application class you use.
Comment 2 GNOME Infrastructure Team 2018-05-02 19:23:07 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/961.