TreeView** and selection (GTK+2.0)



Hello everyone-

I'm trying to develop an application in GTK+2.0 (using gcc) and use the
TreeView** functions.  I'm having difficulties when it comes to selecting
different rows (in GTK_SELECTION_SINGLE mode).  I'm trying to use the
button-press-event single (attached to the tree) and have a right mouse
button pop-up menu.  Everything is fine if the user selects the item first,
but if he/she wants to select an item on the fly, the selected item reported
is the previous item!  It looks like the selection is actually changed
between the button-press- and button-release- events, making this
impossible.

(If you're confused:  "A" is selected, I want to right click on "C" and
while holding, bring up a pop-up menu specific to "C"... this is very common
in nearly every application that uses trees, especially in Windows...)

I've tried using the button-press-event function to copy the event data to a
global variable and then use the "changed" signal to pop the menu... this
works, but only if the selection is changed (the opposite of the original
problem!)  The selection function doesn't help either..

This appears to be possible in GTK_SELECTION_MULTIPLE... but not in
GTK_SELECTION_SINGLE.. ugh!

Any ideas??  I've spent more than enough time on this silly problem already!

Thanks!!!
-Paul





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