Customizing multiple selection behavior in TreeView



There is a TreeView widget whose TreeSelection's mode is SELECTION_MULTIPLE. 

I'd like to change how a single mouse click (and any of the equivalent actions from the keyboard and other 
input methods) on a row impacts the selection. The rest of the selection UI should behave as usual: 
Ctrl+click toggles one row, Shift+click selects a range, Ctrl+A selects all, etc.

By default when the user clicks on a row, the selection is reset so that only the row clicked becomes 
selected. Instead of that, I'd like to make it toggle the selection of the row while leaving other rows alone 
(that's what Ctrl+click does).

I've read the relevant parts of the API docs but still can't come up with a clean way to do that. Could you 
please describe such a way or give any clue about the relevant documentation I might have missed?

By `clean' way I mean reusing what is already in GTK+ rather than reimplementing it. Such code duplication 
can result in UI inconsistencies over platforms and input methods, especially as time goes by.

I'm a GTK+ newbie using the Python wrapper.
Please CC me.



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