>
> Hello,
> I have been developing a GTK application and I am now using GnuPlot to
> create some graphical output.
>
> I was hoping to embed the gnuplot x window results into my GTK
> application.
> So far I have been unable to do that can anyone give me any tips on how I
> would go about this?
>
> Thanks,
>
> Kiran
Hi Kiran,
Thanks for sharing your interest in gnuplot. There are several possible
answers to your question:
1) You could do it in two steps: first, output to png (or whatever
format), using gnuplot 'png' terminal, and then display the png inside
your application, where you want it to be.
Pros: quite easy
Cons: Overhead of the png writing and displaying
2) You could use the following patch:
http://sourceforge.net/tracker/index.php?func=detail&aid=1027032&group_id=2055&atid=302055
It is entitled "Connect gnuplot_x11 to exterior application window" and
does what you want by allowing you to pass an XID in the 'set term x11'
command.
Pros: no overhead, mousing (zoom) should even work
Cons: non-upstream patch, read the patch page for details
3) You could use the 'xlib' terminal. This one (not really restricted to
xlib) will write low-level drawing commands to a file or a pipe, so that
you can then draw by yourself on your window.
Pros: you use the gdk API
Cons: you have to interpret the drawing commmands, as it is done in
gplot_x11.c
I hope this can be useful.
Best regards,
Timothée Lecomte
|