Hi,
I would like to use libplotter (*) with fltk. I imagine that fltk would
generate window, libplotter would draw a plot (possibly animated) in it, and
fltk would handle keyboard and mouse events that would change parameters of a
plot. However, I can't arrive at anything (I am not a professional
programmist). My best shot (below) draws a plot in a window, but plot vanishes
after a fraction of second. I will appreciate any clues about how to proceed.
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
#include <FL/fl_draw.H>
#include <FL/x.H>
#include <plotter.h>
int main(int argc, char **argv) {
Fl_Window *window = new Fl_Window(300,180);
window->show(argc, argv);
Window aaa = fl_xid(window);
PlotterParams params;
params.setplparam("BITMAPSIZE",(void*)"300x180");
params.setplparam("XDRAWABLE_DRAWABLE1", &aaa );
params.setplparam("XDRAWABLE_DISPLAY",fl_display);
XDrawablePlotter *plotter = new XDrawablePlotter(cin, cout, cerr,params);
plotter -> openpl();
ploter -> fspace (0.0, 0.0, 1000.0, 1000.0);
plotter -> fline(0,0, 1000,1000);
plotter -> closepl();
window->end();
return Fl::run();
}
Yours,
Lukasz
(*) http://www.gnu.org/software/plotutils/manual/html_node/plotutils_toc.html
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk