I have a RichTextCtrl in my application, that has a handler for EVT_KEY_DOWN
. The code that is executed is the following :
def move_caret(self):
pdb.set_trace()
self.rich.GetCaret().Move((0,0))
self.Refresh()
def onClick(self,event):
self.move_caret()
event.Skip()
rich is my RichTextCtrl.
Here is what I would like it to do :
on each key press, add the key to the control ( which is default behaviour )
move the cursor at the beginning of the control, first position
Here's what it actually does :
it adds the key to the control
I inspected the caret position, and the debugger reports it's located at 0,0 but on the control, it blinks at the current position ( which is position before I pressed a key + 1 )
Do you see anything wrong here? There must be something I'm doing wrong.