[pygtk] visual feedback when using the keyboard to navigate

Chris Rouch crouch at pobox.com
Fri Oct 8 21:00:09 WST 2004


I have a row of toggle buttons. I'm using the arrow keys to navigate
back and forward (emitting the enter and leave signals as appropriate)
and the space bar to activate. This all works.

However, when I use the mouse to navigate I get visual feedback to show
which button is active (the background and foreground colours change).
When I use the keyboard I get no feedback. I've tried using
b.set_state(gtk.STATE_PRELIGHT) to force the widget into a prelight
state, but I get a warning:

DeprecationWarning: use GtkToggleButton.set_active

And nothing happens. NB I can't use set_active, because I don't want the
button to be active unless I hit the space bar. 

Is there any way to get the button into prelight state? Or any other
way to indicate that the button is active, other than changing the text
or the pango attributes of the label?

Thanks and regards,

Chris


More information about the pygtk mailing list