[wxPython] Using cursor-keys in wxStyledTextCtrl

Hi,
I've an "editor" window based on wxStyledTextCtrl which is used to show some SQL code. If I want to navigate (place the caret), I have to use the mouse. It is not possible to navigate using the cursor keys. Inserting text and removing text works ok.

Does anyone have a clue what I may have done wrong. I have based my code on the wxPython demo-example. The event EVT_STC_UPDATEUI is mapped to the following method:

def OnUpdateUi(self, event):
        lc = self.GetCurrentLine()
        try:
            self.TreeWindow.SetActiveNode(lc+1)
        except:
            pass

where the activates a 'node' in a tree control (corresponding to line number).

Thanks for any help.
Nikolai Kirsebom

I've an "editor" window based on wxStyledTextCtrl which is used to
show some SQL code. If I want to navigate (place the caret), I have
to use the mouse. It is not possible to navigate using the cursor
keys. Inserting text and removing text works ok.

Are you on NT and has your program used a wxFileDialog? If so this is a
strange old bug that no one has been able to figure out yet... If not then
does your self.TreeWindow.SetActiveNode method do something that would move
the keyboard focus away from the STC?

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!