sponsor Vim development Vim logo Vim Book Ad

gtkvim.tgz : GTK+ widget interface to gvim

 script karma  Rating 11/5, Downloaded by 418

created by
Neil Bird
 
script type
utility
 
description
C source to 'GtkVim' widget, which embeds a gvim into your application as if it were a normal widget (actually runs a gvim as another process, displaying in your widget via a GtkSocket).

Requires a GTK+ gvim 6.0 and probably GTK+ 1.2.8 or later.

If you have focusing problems, you may also require the following patch to your GTK libraries (inc. the latest [at time of writing] 1.2.10) for automatic focusing (e.g., upon <Tab>) to work correctly.  Point-and-click activation will still work OK without this patch.

Currently still /not/ working is the ability to set the GtkVim widget's focus at startup (gtk_widget_grab_focus() or gtk_window_set_focus()).

--- gtk/gtkwindow.c.focus Fri Mar  9 18:39:16 2001
+++ gtk/gtkwindow.c Thu Jul  5 10:34:00 2001
@@ -985,7 +985,13 @@
       break;
     case EnterNotify:
     case LeaveNotify:
-      if (xev->xcrossing.detail != NotifyInferior &&
+      /* We only track the actual destination of keyboard events for real
+       * toplevels, not for embedded toplevels such as GtkPlug. The reason for
+       * this is that GtkPlug redirects events so the widget may effectively not
+       * have the focus even if it actually has the focus.
+       */
+      if (gdk_window_get_parent (GTK_WIDGET (window)->window) == GDK_ROOT_PARENT () &&
+   xev->xcrossing.detail != NotifyInferior &&
  xev->xcrossing.focus && !window->window_has_focus)
{
  window->window_has_pointer_focus = (xev->xany.type == EnterNotify) ? TRUE : FALSE;
 
install details
Unpack the tgz file ('tar zxf gtkvim.tgz') somewhere and 'make' in the new directory it creates.  Sorry, no configure or anything, but it's pretty minimalist so shouldn't cause any problems.

Link the gtkvim.o with your app.  See included example cadged from the GTK+ release ('rangewidgets').
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
gtkvim.tgz 1.7 2002-02-08 6.0 Neil Bird Fixed coredump due to incorrectly initialised string (Evan Martin).

gtkvim.tgz 1.6 2001-12-03 6.0 Neil Bird Initial upload

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
Sponsored by Web Concept Group Inc. SourceForge Logo