Re: GtkPlot questions



2008/4/16 Randy Poe <rpoe atl lmco com>:
Does anyone have any experience with the GtkPlot widget in
 the GtkExtra library?

 I am trying to write a button callback which generates the
 plot. This plot is on one of a set of tabbed panels. I was
 going crazy trying to figure out why I never
 saw any output, until I realized that the graph gets
 painted if I switch to another tab, then switch back.

It's not a very well-behaved gtkwidget. You have to call
gtk_plot_paint() explicitly to get the canvas to be drawn, then queue
another draw on the widget to get the screen to update.

        gtk_widget_show_all( plotpresent->canvas );
        gtk_plot_paint( GTK_PLOT( plotpresent->plot ) );
        gtk_widget_queue_draw( plotpresent->canvas );

Here's the thing that makes plots in my app, you're welcome to nick
stuff if you like:

  http://vips.svn.sourceforge.net/viewvc/vips/nip2/trunk/src/plotpresent.c?view=markup

I had to patch the plot widget a bit to get it working nicely, you
might want to look at the copies of the gtkplot* source in the same
directory.

John



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]