Re: Handling picking with Gtk



tomas tuxteam de wrote:
On Wed, Nov 29, 2006 at 03:31:03PM +0100, Yann Renard wrote:
Hi people, I'm new to the list and have a question.

I have used Gtk for a couple of weeks now in cooperation with glade
(wonderfull tools !!). I have a small problem on custom widgets [...]

At this point, I have to chose wich of my custom
objects (drawn in the GtkDrawingArea) has been clicked. The common way
of doing that is to prepare something like a *stencil* buffer while
rendering the colors [...]

Just to be sure I got you right and for the benefit of others who might
have better ideas: you render all of your objects on one drawing area
and would like to know which ones of them have been hit by the click
event, right?

If you don't mind pulling in the whole gorilla (pun intended ;) there is
the GnomeCanvas widget, which probably offers all the functionality you
are trying to implement plus some more. It has a nice interface too (imo).

There have been attempts to port GnomeCanvas to GTK[1], but they seem
dormant at the moment (but it may fulfill your need or furnish you with
some inspiration).

I for one wouldn't mind seeing the Canvas in GTK, but I won't complain,
since I'm not putting time in it...

----------------
[1] <http://freshmeat.net/projects/gtkcanvas/>
[2] <http://www.atai.org/gtk-canvas/>

Regards
-- tomÃs

Dear Tomas,

you perfectly understood my problem. However, I think your proposition
does not perfectly match my needs. First, I write portable code. I
haven't checked yet but I guess gnome widgets won't run under windows.
Moreover, I don't use gnome libs for now and I think starting using them
for this only widget would result in heavier application for little
service gain.

The functionnality I requested should probably be possible whith either
GDK or GTK... Do you claim this is not possible ?

Thank you very much for your answer anyway, I will have to check the GTK
ports and maybe find other information threre...
Best regards,

Yann Renard



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