Re: [gtk-list] Re: Proposal: how about a gtk_canvas widget?



Des Herriott <des@ops.netcom.net.uk> writes:

> Having thought a bit more about how such a canvas would work, each item
> type would need its own list of properties; e.g. location, colour, line
> width.  All items would have a common set of properties (location, for
> example), and some item would have their own (an arc item needs a
> number of degrees to rotate through, for example).  Hmm, maybe a
> gtk_canvas_item class & subclasses would be useful...

Depending on how lightweight gtk_objects are.  I was going to ask
about this some time back when I was considering something similar.
If you do it this way, then it's much easier to extend, and as far as
postscript output goes (if anyone cares), each item can just have a
postscript_dump "method".

> As for tags, what's needed is to map an arbitrary tag number (or
> string) to a list of canvas items, within the canvas object.  Then any
> function can refer to a list of items by just naming a tag...

Definitely a job for GHashTable.

-- 
Rob Browning <rlb@cs.utexas.edu>
PGP fingerprint = E8 0E 0D 04 F5 21 A0 94  53 2B 97 F5 D6 4E 39 30



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