[Glade-users] Canvas questions

James Cameron james.cameron@compaq.com
Tue, 10 Oct 2000 14:59:24 +1100


G'day George,

1. check for other code that uses the GnomeCanvas. 
http://cvs.gnome.org/lxr/ may help.

2. that warning is because you are not casting correctly.

George wrote:
> I have the following code in callbacks.c assigned to a button
> GtkWidget *canvas1;
> canvas1 = lookup_widget (GTK_WIDGET (button), "canvas1");
> item = gnome_canvas_item_new(gnome_canvas_root(canvas1),

You have two choices (a) change the variable type and cast the output of
lookup_widget, or (b) cast it when you use it.

(a)
GnomeCanvas *canvas1;
canvas1 = GNOME_CANVAS (lookup_widget (GTK_WIDGET (button), "canvas1"));
item = gnome_canvas_item_new(gnome_canvas_root(canvas1),

(b)
GtkWidget *canvas1;
canvas1 = lookup_widget (GTK_WIDGET (button), "canvas1");
item = gnome_canvas_item_new(GNOME_CANVAS(gnome_canvas_root(canvas1)),

> 3. I cannot get the text to show up at all. I cannot find an example
> anywhere that uses text.

I'm afraid I haven't used this widget yet either.  ;-)

-- 
James Cameron                                      (cameron@stl.dec.com)