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





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