python-gui icon indicating copy to clipboard operation
python-gui copied to clipboard

embeddable gtk widget

Open gour opened this issue 9 years ago • 3 comments

Hello,

recently I switched from Emacs to Vim and use it as external editor in Claws-mail by having the following line in Preferences:

gvim '+set filetype=mail' -f --socketid %w %s

Now, I'd like to switch to Neovim and after having some chat in #neovim, was advised to ask here if Neovim could be embedded into Claws via python-gui?

gour avatar Jul 03 '16 09:07 gour

--socketid is a feature shipped with some gtk versions of gvim. http://vimdoc.sourceforge.net/htmldoc/gui_x11.html#gui-gtk-socketid It implements GtkSocket interface which can be embedded in other GTK apps (such as Claws).

It appears pygtk has some support for this: http://www.pygtk.org/pygtk2reference/class-gtksocket.html

justinmk avatar Jul 03 '16 09:07 justinmk

This is definitely doable, just someone needs to put in the work to either refactor the python-gui to a widget + a command line interface to accept the socket id or (larger effort, but more widely usable) implement a nvim Gtk widget in C, possibly using @tarruda:s libmpack (I would imagine the widget taking an address/fd and communicate with nvim via gtk:s event loop, this usecase shouldn't need python-gui:s awkward two-thread indirecton).

Minor nit: we are using Gtk3 (and thus aren't constrained by what pygtk supported) but I would suppose the socket protocol to be the same (thin wrapper around XEmbed?).

bfredl avatar Jul 03 '16 15:07 bfredl

Python 3 + Gtk 3 + gi still work well with Gtk.Socket and embedding vim. This is however a dying tech, only supported on X and not when using wayland.

bluss avatar Mar 05 '17 18:03 bluss