Skip to content Skip to sidebar Skip to footer

Python Gtk Notebook Focus Chain

I'm trying to setup a window with a notebook and some pages. Within the pages, there will be some entries (see example code). I'd like to handle the tab key and arrow keys on my ow

Solution 1:

Found it.

Listening to the key-press-event and returning "True to stop other handlers from being invoked for the event. False to propagate the event further.

        window.connect("key-press-event", self.do_key_press)

    defdo_key_press(self, widget, event):
        if gtk.gdk.keyval_name(event.keyval) == 'Tab':
            print"tab"returnTrueif gtk.gdk.keyval_name(event.keyval) == 'Left'or gtk.gdk.keyval_name(event.keyval) == 'Right':
            print"cursor"returnTruereturn

Post a Comment for "Python Gtk Notebook Focus Chain"