problems with gnome_canvas_item



I am having problems getting a gnome_canvas_item working.  In an
initialization routine, I create a new line canvas item by doing:

line = gnome_canvas_item_new (gnome_canvas_root (root),
        gnome_canvas_line_get_type(), NULL);

I get the following error when I execute this line:

Gtk-CRITICAL **: file gtkobject.c: line 939 (gtk_object_add_arg_type): assertion `arg_type > GTK_TYPE_NONE' failed.

I assume I'm getting this because I haven't specified any points to draw
the line.  This is by design, because I do the actual drawing later in a
draw routine by doing:

gnome_canvas_item_set (line,
        "points", cp,
        "fill_color", "orange",
        NULL);

This line causes a segfault and I get the following error:

GnomeUI-WARNING **: gnome_canvas_item_set(): could not find argument
"points" in the `GnomeCanvasLine' class ancestry

I'm doing the exact same thing for a rectangle and it works fine for it.
I create the rectangle with no dimensions, and then I 'set' the
dimensions when I call the draw routine.  Why doesn't this work for
lines?

Thanks
Jason




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