Re: Drawing area feature?

Yes It's exactly what I want. But even if the gnomecanvas is the best
widget for my purpose, I will probably had to only use Gtk.
You said "traverse your list of objects to see which one was clicked".
There is no way to do this with a smart trick? With a "mask color" for
example? Or something else... any idea?

James Eagan wrote:

On Wed, Apr 18, 2001 at 05:43:39PM +0200, CALMELS Clement wrote:

I want to select an element of a drawing area (rectangle, arc...). How I
could do that?

Am I correctly interpreting your question as: you want to be able to draw
objects to the drawing area (i.e. rectangles, circles, whatever), and be able
to later grab that object and manipulate it in some fashion (i.e. user clicks
in rectangle, so border changes colour)?

There are a couple of ways to do this:  if you don't mind using the
gnome-libs, you might want to check out the gnomecanvas.  It behaves in this
manner "for free."  Otherwise, you'll probably have to do the bookkeeping
yourself: have some rectangle object.  When you get a click event, traverse
your list of objects to see which one was clicked.  Redraw with the
appropriate changes made to the desired object.


gtk-app-devel-list mailing list
gtk-app-devel-list gnome org

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