Re: Adding Tk Canvas tags to Gnome Canvas - looking for inputs



Skip Montanaro <skip pobox com> writes:
> I'm new to Gnome and haven't yet figured out all the ways to communicate in
> the Gnome community.  Please let me know if this list is not correct for
> discussion of extensions to the Gnome canvas widget.

It's the right list for now, yep.

> I will be doing some work for a customer who is porting some large
> applications from Python+Tkinter to Python+Gtk+Gnome.  In their original
> application they make heavy use of the tags system that is part of the Tk
> canvas widget, and have expressed interest in adding that functionality to
> the Gnome canvas widget.  I took a look at the Tk canvas code.  The
> implementation of tags looks pretty straightforward, so I was a bit
> surprised to not find them already implemented or at least on the to-do list
> at the top of gnome-canvas.c.

Tk "tags" translate to "object properties" in GTK. This is how you use
canvas items, if you look at some of the example code
(gnome_canvas_item_set()). I believe the Python bindings provide some
way to access object properties, but I could be wrong.

> I hope you can give me a little insight about the decision to not include
> this capability in Gnome's canvas widget and what thoughts, if any, you have
> about incorporating tags into the canvas widget in the future.  Is the
> programming model sufficiently different that tags don't make sense?  If
> there are requirements you'd place on such an implementation (API,
> performance, etc), I am at this point the proverbial clean sheet of paper.

Tk tags don't map exactly to "how GTK works," since we have
alternative mechanisms for doing the same job. Even if you added tags,
they would be a bit different from the Tk tag set, simply because the
canvas changed a bit when moving from Tk into GNOME. So I don't think
adding tags to the canvas widget would really be a viable way to port
a legacy application.

Havoc






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