Red Hat Bugzilla – Bug 52394
strange behavior of <up>/<down> keys in listboxes
Last modified: 2007-04-18 12:36:19 EDT
When visiting a listbox the first time and pressing the <up> or <down> keys
the mark jumps to the beginning of the listbox.
E.g. at the "Language Selection" screen (first screen), "English" is
selected. Then press <TAB> until the listbox is activated. Now "Chinese
(Simplified)" is selected and <down> selects "Chinese (Traditional)", <up>
is not working.
The expected result would be the selection of "Czech" at <up> and "French"
All other listboxes are affected also and it's very annoying in these where
are a lot of possible selections (e.g. keyboard-type).
Owen, is this a GTK problem? I don't think I have any control over the keyboard
navigation of the this widget, do I?
Well, yes and no. The problem is that the selected row is different
from the focus row. There unfortunately is no easy way to move
the focus row. There are hacks to do this by emitting
::scroll_vertical the right number of times, but I doubt you
can do this from Python.
GtkTreeView has gtk_tree_view_set_cursor() with both sets the cursor
row and selects it.
--- language_gui.py 2001/08/07 15:42:06 1.19
+++ language_gui.py 2001/08/23 21:20:10
@@ -70,6 +70,14 @@
if default > 0:
self.language.select_row (default, 0)
+ row = self.language.focus_row
+ if row != default:
+ if row < default:
+ step = SCROLL_STEP_FORWARD
+ step = SCROLL_STEP_BACKWARD
+ for i in range(abs(default - row)):
+ self.language.emit("scroll_vertical", step, 0.5)
sw = GtkScrolledWindow ()
When we move to GTK+2.0 we'll be using GtkListView and we'll fix this then.