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



On May 08, robert havoc pennington wrote:
> You should look at the Gtk-- canvas, there used to be a link on the Gtk--
> web page, it doesn't have the tags, etc. but it has some stuff already
> done and should be easy to port back to C (then it can be re-wrapped for
> Gtk-- use). 

I've just browsed the header file for the Gtk_Canvas class - it's more
of a friendly wrapper to the GDK drawing functions than a full
object-based drawing surface like the Tk canvas.  I don't think it's
quite what I want.

There now follow some more random musings:

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...

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...

The Tk canvas also allows a group of items to be tagged based on a
reasonably powerful search spec., e.g. tag all items, all items within
a bounding box, all items which stack above a given item, and so on.
This would also be desirable to implement somehow...

-- 
Des Herriott
des@ops.netcom.net.uk



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