[pygtk] Problem with GtkTreeView
aheinlein at gmx.com
Wed Sep 1 18:28:34 WST 2010
Am 31.08.2010 15:48, schrieb Greg Bair:
> On 08/31/2010 08:34 AM, Andreas Heinlein wrote:
>> I have a problem with a GtkTreeView in one of my apps, and I hope you
>> can help me.
>> I have a window containing a a GtkTreeView and displaying a list, backed
>> by a GtkListStore if that matters. The TreeView contains four columns,
>> the first one contains a GtkCellRendererToggleButton, the other ones
>> each a GtkCellRendererText.
>> I put the initial focus on the TreeView and can navigate the list up and
>> down with arrow keys and toggle the button in each row with space. But
>> if I click on the text in one of the rows, the row is highlighted, and
>> the text is focussed, i.e. there is a thin dotted frame around it.
>> Pressing space now does not toggle the button, only if you move the
>> focus back to the toggle button using e.g. left arrow it will work again.
>> What I want is to mimic windows behaviour, i.e. clicking anywhere on a
>> row and pressing space toggles the button, no matter where exactly you
>> Any way to accomplish this?
> You can connect a signal to the treeview. It has a signal of
> "row-activated" which is emitted when a row is highlighted and user
> hits space (or one of the other keys listed in the docs). You could
> then use this to toggle the button.
> pygtk mailing list pygtk at daa.com.au
> Read the PyGTK FAQ: http://faq.pygtk.org/
This worked. Thank you very much.
More information about the pygtk