[GRASS5] Embedding GRASS display in my application
Glynn Clements
glynn.clements at virgin.net
Tue May 4 18:35:21 EDT 2004
Sajith VK wrote:
> Thanks Glynn for the help...(And sorry for delay in trying)
> It worked perfectly when I passed XID of a window, But nothing
> happended when I passwd XID of a gnomecanvas.window...
> May be some issue with gnomecanvas or so.. I will try...
You need to ensure that your application (or the toolkit) doesn't
either:
a) fill the window with a "background", or
b) replace the window's background pixmap.
as doing either of those will prevent the background pixmap's contents
from being visible.
Essentially, you need to use a "bare" window; one which XDRIVER can
use (almost) exclusively.
> B/w I read that display modules and XDRIVER communicates
> through sockets/fifo. (Am I correct?).. Can I read the
> draw instrucions from the socket/fifo and write myown
> functions to render them to my canvas? If possible it offers
> me highest flexibility....
You can write your own driver; see src/display/devices/lib for the
framework and default implementations.
However, if you do this, any display commands which your application
spawns will have to run in a separate process or thread. Using e.g.
system("d.rast ...") won't work, as your application will block until
the command completes, but the command won't complete until your
application has read and processed the commands which the program
issues.
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-dev
mailing list