Re: Gnome canvas example?



"David J. Topper" a écrit :
> 
> Hi all,
> 
> 1.  Are there gnome mailing lists?  I didn't see any reference on
> developer.gnome.org.

Yes there is. There is about 6 mailing lists different for gnome.
Go to http://www.gnome.org/resources/mailing-lists.html

> 
> 2.  Are there some better examples than those on developer.gnome.org?
> I'm parsing through the gnome-canvas example included with the library
> ... the arrowhead one to be specific.
> 
> Can someone fill me on in how this works (taken from the arrowhead
> example):
> 
>  points = gnome_canvas_points_new (2);
>  points->coords[0] = LEFT;
>  points->coords[1] = MIDDLE;
>  points->coords[2] = RIGHT;
>  points->coords[3] = MIDDLE;

LEFT, MIDDLE, RIGHT, MIDDLE should bo in float format. Do not know if
it is the case but.

> 
>  item = gnome_canvas_item_new (root,
>           gnome_canvas_line_get_type (),
>           "points", points,
>           "fill_color", "mediumseagreen",
>           "width_pixels", DEFAULT_WIDTH * 10,
>           "last_arrowhead", TRUE,
>           NULL);
> 
> The coordinates are 1 dimensional!  So how does this draw a 2D arrow?

How can you draw a 1D arrow ?
When you declare gnome_canvas_points_new (2) you declare two points.
coords[0], coords[1] are x,y coordinates for the first point, and
coords[2], coords[3] are for the second point.


> I'm sure it happens elsewhere in the code, but still.  Seems a bit odd.
> No X/Y concept here.
> 
> Also ... I can't find a complete ref. for args to
> gnome_canvas_item_new.  It seems some are reserved (like points?) while
> others you can define yourself.

look to the GGAD book from Havoc
http://cvs.gnome.org/lxr/source/web-devel-2/content/doc/GGAD/

> 
> Similarly for gnome_canvas_points_new().  Can't find any docs for it.
> 
> I'd love to start using more GNOME code but this kind of omission from
> docs makes it really hard.



-- 
Florent DEVIN




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