[ gpsdrive ] Embedded GpsDrive using GTK Plug (XEMBED)
Jim Gruen
jgruen at gmail.com
Wed Jan 2 19:35:50 AKST 2008
Hello folks,
After a cursory search of the mailing list archives, I could not find
a similar patch to this. So I have attached a very small diff to the
GpsDrive trunk that enables "embedded" mode using a new command-line
parameter, '-m'. This will cause GpsDrive to use a GTK "Plug" instead
of a "Window," then print out the window's ID to standard output.
Meanwhile, the GUI will not appear until a GTK "Socket" in a separate
application uses that same ID to embed and show the GpsDrive GUI. Why
do this? Because I am using this to embed GpsDrive into a PyGTK CarPC
application. For a small example of using a GTK Socket from Python,
look here*:
http://www.pygtk.org/pygtk2tutorial/sec-PlugsAndSockets.html
Note that I am not sure if this will compile on Win32, as that
platform may not have Plug/Socket support from GTK (to remedy this,
some #ifdefs could be added around the relevant GTK Plug code in
main_gui.c).
Comments are welcome!
Cheers,
-Jim
(*) Note also that the socket.py example on the referenced website
expects a decimal window ID on the command line, instead of the normal
hex. To fix this, add ', 16' (the number 16 as a second parameter) to
the call to long(argv[1]).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gpsdrive.diff
Type: application/octet-stream
Size: 3218 bytes
Desc: not available
Url : http://lists.gpsdrivers.org/pipermail/gpsdrive/attachments/20080103/d78f9d9a/attachment.obj
-------------- next part --------------
--
Jim Gruen
More information about the GPSdrive
mailing list