Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

embeddable gtk widget #24

Open
gour opened this issue Jul 3, 2016 · 3 comments
Open

embeddable gtk widget #24

gour opened this issue Jul 3, 2016 · 3 comments

Comments

@gour
Copy link

gour commented Jul 3, 2016

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?

@justinmk
Copy link
Member

justinmk commented Jul 3, 2016

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

@bfredl
Copy link
Member

bfredl commented Jul 3, 2016

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

@bluss
Copy link

bluss commented Mar 5, 2017

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.

@justinmk justinmk changed the title embedding neovim in Claws-mail embeddable gtk widget Mar 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants