Re: using GtkPlot from Gtk+Extra without canvas





----- Original Message ----
From: Tristan Van Berkom <tvb gnome org>
To: François Galea <francois galea prism uvsq fr>
Cc: gtk-app-devel-list gnome org
Sent: Tuesday, January 9, 2007 1:04:42 PM
Subject: Re: using GtkPlot from Gtk+Extra without canvas

On Tue, 2007-01-09 at 18:41 +0100, François Galea wrote:
Tristan Van Berkom a écrit :
On Tue, 2007-01-09 at 15:27 +0100, François Galea wrote:
hi,
[...]
The results are a bunch of messages of the form :

(plot2:3556): Gtk-CRITICAL **: gtk_widget_realize: assertion 
`GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed

Hi,
   those assertions mean that the widget you are trying to realize
is not anchored - that means that its not inside a toplevel widget.

by looking at your code, looks like you never add the gtk-plot
widget to your hierarchy.

Hi Tristan,

Thank you for your quick answer.

Adding the GktPlot to the hierarchy doesn't help much. It just 
suppresses the error messages, but doesn't display anything either.

If I'm not mistaken, GtkPlot is a GtkWidget, so it must be in the
hierarchy to be displayed - I thought that the critical messages
were a good hint for that.

Now I dont know about GtkPlot itself, but I suppose once its in
the hierarchy it should display itself - now, what exactly is a
GtkPlot ? what does it display ? did you give it any content
to display ? A widget with no content to display should typically
size-request to take no space (for example a GtkLabel with a zero
length string) - probably leaving you with a grey background.

In fact, I just would like to be able to draw a plot in a drawable 
widget, such as a drawing area. It seems the GtkPlot is not drawable by 
itself (eg. creating a pixmap using plot->window as a reference 
GdkDrawable displays a Gdk error message), thus the idea of using a 
GtkDrawingArea. Maybe I am wrong, please correct me if so.

    "creating a pixmap using plot->window as a reference GdkDrawable"

What does that mean ?

Cheers,
                   -Tristan

François,

I know a little about GtkPlot, and there is an example that ships with the package.  Tristan is correct, it 
is a self contained widget and needs to be added to your window hierarchy and made visible to be displayed.  
Further you need to use its api's to create series data to have that series data plotted.  It is not a 
general purpose plotting area, so you must restrict yourself to using its api's for everything to maintain 
the desired visual.  I need to review your code again to better answer your question, I will post again after 
I do.   Until then you can do two things 1) review GtkExtras/GtkPlot sample programs to better understand how 
the package works, 2) look at this code which produces a simple 2D linegraph and maybe use to to write your 
own routine: http://sourceforge.net/project/showfiles.php?group_id=157888 (Get the glinegraph...bz2 
sub-package)

James,


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list






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