I have a application which ask the user for a input (wx Python). I want to control what is inside the TextCtrl so I added the event: wx.EVT_CHAR. The function work properly except that I want the position of the curently entered charater.
Let say I only want a charater to be at one place, I need the position of it. That my prob.
def handle_keypress(self, event, entry):
key = event.GetKeyCode()
keycode = [1,2,3,4,5,6] #example
bool = False
for char in keycode:
if key == char:
bool = True
break
if bool == True:
event.Skip()
thx, I hope you guys can help me!
PS: Sorry for my bad english :(
EDIT: Problem solved!
I though the problem would be in the EVT_CHAR: http://www.wxpython.org/docs/api/wx.KeyEvent-class.html
But it's not, it was in the TextCtrl: http://www.wxpython.org/docs/api/wx.TextCtrl-class.html
The method GetInsertionPoint() worked!