Arrow keys going to container as well as widget



    Hi,

    I'm porting some free software I developed from Windows to GTK+. The two
parts of this are a source code editing widget (Scintilla) and an editor
application using this widget (Tide - web site at
http://hare.net.au/~neilh/ScintillaTide.html ). In the GTK+ version of Tide,
the widget hierarchy looks like:

    Tide Window (with attached keyboard accelerators)
        vbox
            Menu Bar
            vpaned
                Scintilla (derived from fixed) for editing
                    draw area
                    scroll bar horizontal
                    scroll bar vertical
                Scintilla (derived from fixed) for output messages
                    draw area
                    scroll bar horizontal
                    scroll bar vertical

    I've not managed to get keyboard focus working well. The main window
interprets arrow keys to move between the windows. First, the Scintilla
widget that has grabbed the focus receives the key down. It returns TRUE to
say it has consumed the key, but the top level window still interprets the
key. I have read the code that performs the interpretation of the arrows and
other navigation keys (in gtkwindow.c IIRC), but can not see why it is
ignoring the return code. The 'can grab' and sensitive bits on every widget
apart from the Scintilla ones are turned off.

    For now, the _after variant of signal connection is used to ensure that
only the Scintilla widget sees the arrows, but this stops the keyboard
accelerators attached to the top level window from working.

    Another problem is that control + arrow keys are not seen at all.

    Neil Hodgson




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]