From: Adrian F. <fe...@ma...> - 2002-09-04 18:35:48
|
There is something about the new expose events handling in gtk2. Under an expose event, gtkplocanvas refreshes the pixmap, whithout modifying the contents. If you want to refresh the contents, you need to call gtk_plot_canvas_paint before. gtkplot doesn't handle expose events, they are handled by the canvas. The equivalent for an expose event in gtkplot is gtk_plot_refresh, which refreshes the pixmap. The same, if you want to refresh the contents, you need to call gtk_plot_paint before. when removing a dataset, thare are two thing that you can do: 1) gtk_plot_remove_data gtk_plot_paint gtk_plot_refresh 2) gtk_plot_remove_data gtk_plot_canvas_paint gtk_widget_queue_draw(canvas) If you have more than 1 plot in a canvas, or you have canvas items like arrows or squares, or some image, 2) is the correct approach. If you want a quick redraw, then use 1). Saludos, <ADRIAN> On 4 Sep 2002, Ian Bairstow Spielman wrote: > Thanks for your help. Your suggestion did work -- today's data will be > my first Labview / Windows free data set ;). > > Ian > > > > On Fri, 2002-08-30 at 18:58, Adrian Feiguin wrote: > > BTW, use remove_data to remove the old dataset, and add_data to add the > > new one, the same way you've been doing. Tell me if it worked. Saludos, > > <ADRIAN> > > > > On 30 Aug 2002, Ian Bairstow Spielman wrote: > > > > > Hi! > > > I am writing a data-aquisition program with a GtkPlot Widget as the > > > real-time display. I have it set up so each data trace is added to the > > > plot as they are taken. I want the user (me) to be able to remove old > > > traces if desired. No matter what I do I can't remove a trace! > > > > > > Here is what I do and what I have observed: > > > > > > [ I'm using the gtkextra-2 fork from CVS ] > > > > > > To remove the data I use: > > > > > > gtk_plot_remove_data(GTK_PLOT(ActivePlot), dataset); > > > > > > (nothing happens), and if I take a new data trace the old one is still > > > displayed, even though things like: > > > > > > g_list_length (GTK_PLOT(ActivePlot)->data_sets)) > > > > > > indicate that the number of data_sets have been properly de-incremented. > > > Moreover, if I (X and Y are the array of gdoubles containg the data on > > > the figure): > > > > > > g_free(X); g_free(Y); > > > > > > The program will generally segfault on the next call of: > > > > > > gtk_plot_refresh(GTK_PLOT(ActivePlot), NULL); > > > > > > This tells me that somewhere pointers X and Y are still in use. Can you > > > offer any suggestions? > > > > > > Thanks, > > > Ian Spielman > > > > > > -- > > > > > > > > > > > > ------------------------------------------------------- > > > This sf.net email is sponsored by: OSDN - Tired of that same old > > > cell phone? Get a new here for FREE! > > > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > > > _______________________________________________ > > > Scigraphica-gtkextra mailing list > > > Sci...@li... > > > https://lists.sourceforge.net/lists/listinfo/scigraphica-gtkextra > > > > > > > > -- > > |