Re: [gtk-list] Re: Should there be a gtk "canvas" widget?



Rob Browning <rlb@cs.utexas.edu> writes:

> I have been working off and on on a gtksketchpad widget (a lightweight
> canvas) which does essentially what you mention.

I'd really like to have something like the Tk canvas for gtk+.  I have
planned to work on one when time permits and I'm happy that people
have already started.

Of course, I want to mainly have it for interpreted languages, where
there might be performance problems when the exposure is being done
with interpreted code.

> > 	plot.set_foreground("red");
> > 	plot.draw_line(10,10,plot.width()-10,10);
> 
> That's nice, and I don't handle colors as strings, but I did go a
> little further and have the add_XXX function return a pointer that
> you can use to later move the object around, etc.

That is an important point, IMO.

However, I would like to have these canvas objects (lines, arcs, etc)
integrated into the regular gtk object system.

That is, you would have a GtkCanvasObject that is derived from
GtkWidget.  You can attach to the normal signal handlers, etc.

Some additional points that come to my mind:

It should be fairly simple to write new canvas objects, so that you do
not have to spend a million line objects for a grid, say.

What about implementing the PDF primitives as basic canvas objects.
Does X11 allow for efficient, filled, clipped, bezier curves?

Can we afford to always have a backing pixmap for the whole image?  If
not, how can we get flicker free updates?  How does Tk handle this?

Anyway, I'm not working on anything right know...



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