Re: GtkTreeView



mwoelke <mwoelke csc-dd de> writes:

> hi there,
> 
> i ve a problem with selecting in a treeview. i need to have a callback
> placed after the selection has been done by gtk_tree_view_button_press.
> the callback needs to find out what rows have been selected to adjust
> the surrounding UI. the point is, that gtk_tree_view_button_press
> returns TRUE upon successfull execution, preventing any further
> callbacks from being run. is this 'TRUE' an error or just the way u
> wanted it to be.

Basically, the idea is that each event can be handled by only a single
party -- if multiple parties handle an event, then you get problems
like stuck grabs.

For cases where people really need to observe events but not act on them
we have the ::event-after signal, but really, that's not a good idea
in a case like this, because you are just assuming you know what will
affect the selection. The selection might also be affect from:

 - The user changing the selection with the keyboard
 - An accessibility tool (say, a voice control tool) changing the selection

So, instead, get the selection object and listen for changes on it.

 http://developer.gnome.org/doc/API/2.0/gtk/gtktreeview.html#GTK-TREE-VIEW-GET-SELECTION
 http://developer.gnome.org/doc/API/2.0/gtk/gtktreeselection.html#GTKTREESELECTION-CHANGED

Regards,
                                        Owen



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