Am 31.08.2010 15:48, schrieb Greg Bair: > On 08/31/2010 08:34 AM, Andreas Heinlein wrote: > >> Hello, >> >> 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 >> click. >> >> Any way to accomplish this? >> >> Thanks, >> Andreas >> > You can connect a signal to the treeview. It has a signal of > "row-activated"[1] 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. > > [1]http://www.pygtk.org/docs/pygtk/class-gtktreeview.html#signal-gtktreeview--row-activated > _______________________________________________ > pygtk mailing list [email protected] > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://faq.pygtk.org/ > This worked. Thank you very much.
Andreas _______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
