Re: [gtk-osx-users] cut/copy/paste accelerators in GTK widgets (and some other issues)




On Dec 26, 2014, at 9:33 AM, Brecht Machiels <brecht__gmane mos6581 org> wrote:

Hello,

I'm trying to adapt Zim (Python + pygtk) [1] to make use of gtkosx-application, but I'm running into a 
number of problems.

The first two are related to building gtk-mac-integration (the 2.0.5 tar.xz) and are no show-stoppers.
Some background info: I installed gtk+ (using --without-x11) and pygtk (from source) using Homebrew. I 
configured gtk-mac-application with --with-gtk=gtk+-2.0.

1) The makefile doesn't build the python bindings, even though --enable-python=all is the default. I ended 
up cd-ing into the bindings/python folder and running "make install" manually, which worked fine. Am I 
wrong to expect the Python bindings to build automatically?

The python bindings require that configure finds the python headers. As always with autotools-based projects, 
study config.log to understand why configure doesn't do what you expect.


2) Building bindings/python/gtkmacintegration fails with error messages such as:
      gtkmacintegration.override:25:5: error: unknown type name 'GtkMacMenuGroup'; did you mean 
'GtkAccelGroup'?
I ignored this for now, as I understand gtkmacintegration is deprecated anyway.

That's probably because you're building on 64-bit, and the Carbon API isn't available on that architecture. 
You bypassed the configuration for Python and wound up trying to compile code that isn't supported by the C 
code you built. Fix your environment so that configure finds everything it needs for Python and build again. 
If you're building only for your own use, 


With gtkosx-application installed, I have managed to move Zim menus to the OS X menu bar and 
About/Preferences/Quit to the application menu without much trouble, but there are some problems remaining.

3) I changed all of Zim's keyboard accelerators to use <Primary> instead of <ctrl>. This works as expected 
for all accelerators in the main Zim text editor widget. However, in other widgets (such as a search box), 
the Cmd-x/c/v accelerators do not work. Ctrl-x/c/v do, however.

I did come across the "modifyng Gtk-2 keybindings" thread on this mailing list, where it was recommended to 
set
      gtk-key-theme-name="Mac"
in ~/.gtkrc-2.0
While this doesn't work with the Homebrew GTK+, adding
      include "/usr/local/Cellar/gtk+-quartz/2.24.11/share/themes/Mac/gtk-2.0-key/gtkrc" 
should have the same effect, I think.
Now, the search box in Zim's main window will work with Cmd-x/c/v, but text widgets in other windows 
(dialogs) don't, and they won't react to Ctrl-x/c/v anymore either. Is there any way to make this work as 
expected?

Possibly not. PyGtk hasn't been maintained for some time and may not have kept up with the changes to the key 
handling code in Gtk+-2.24. It has nothing to do with gtk-mac-integration, which only handles menus.


4) Finally, Zim's application name in the menu bar is "Python", for obvious reasons. Is it possible to 
change this to Zim somehow? Similarly, would it be possible to replace the icon the in dock with Zim's icon?

Bundle Zim. See https://wiki.gnome.org/Projects/GTK%2B/OSX/Bundling.

Regards,
John Ralls


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