Hi Again,
I think I now know the problem, well just my assumption. Whenever I key-in a character in the text field, the EVT_TEXT automatically responds. The problem is I use ‘SetValue()’ inside my event handler to transform the text to uppercase and set the field with that value. This probably makes the problem of ‘Maximum Recursion Depth’ because EVT_TEXT also responds to SetValue() in the text field. So there seems to be an endless loop here.
On the otherhand, while I probably know the problem, I still don’t know how to handle this. I don’t intend to use post processing like let the user keyin characters whether in upper or lowercase and eventually transform them into uppercase after another event. I still want to set the field in uppercase.
I hope to hear from anyone of you.
Teddy
···
----- Original Message -----
From: Teddy Ladran
To: wxpython-users@lists.wxwidgets.org
Sent: Thursday, May 06, 2004 1:38 PM
Subject: Maximum Recursion Depth Exceeded
Hi,
I am Teddy and I am beginner in wxPython. I have one problem pertaining to EVT_TEXT and I don’t know why I am getting it. I am trying to convert characters in text ctrl field into upper case by calling EVT_TEXT to respond whenever a character is typed in the field. But everytime I get the last insertion point, the program issues this error ‘Maximum Recursion Depth Exceeded’. First, I would like to know what exactly does this error message mean. Second, how could I avoid it. Third, is there any other way I could set the text field in upper case so I won’t need to call EVT_TEXT.
I’m trying to learn more about wxPython. Your help will be much appreaciated.
Thanks and have a nice day to all.
Teddy
Message
Hello,
I think you should avoid to call SetValue() within the event handler.
In your event handler, call SetValue() with wx.CallAfter().
M. Vernier
···
-----Original Message-----
From: Teddy Ladran [mailto:teddyladran@dsme.co.kr]
Sent: Thursday, May 06, 2004 7:53 AM
To: wxpython-users@lists.wxwidgets.org
Subject:
[wxPython-users] EVTY_TEXT: Maximum Recursion Depth Exceeded
Hi Again,
I think I now know the problem, well just my assumption. Whenever I key-in a character in the text field, the EVT_TEXT automatically responds. The problem is I use ‘SetValue()’ inside my event handler to transform the text to uppercase and set the field with that value. This probably makes the problem of ‘Maximum Recursion Depth’ because EVT_TEXT also responds to SetValue() in the text field. So there seems to be an endless loop here.
On the otherhand, while I probably know the problem, I still don’t know how to handle this. I don’t intend to use post processing like let the user keyin characters whether in upper or lowercase and eventually transform them into uppercase after another event. I still want to set the field in uppercase.
I hope to hear from anyone of you.
Teddy
----- Original Message -----
From: Teddy Ladran
To: wxpython-users@lists.wxwidgets.org
Sent: Thursday, May 06, 2004 1:38 PM
Subject: Maximum Recursion Depth Exceeded
Hi,
I am Teddy and I am beginner in wxPython. I have one problem pertaining to EVT_TEXT and I don’t know why I am getting it. I am trying to convert characters in text ctrl field into upper case by calling EVT_TEXT to respond whenever a character is typed in the field. But everytime I get the last insertion point, the program issues this error ‘Maximum Recursion Depth Exceeded’. First, I would like to know what exactly does this error message mean. Second, how could I avoid it. Third, is there any other way I could set the text field in upper case so I won’t need to call EVT_TEXT.
I’m trying to learn more about wxPython. Your help will be much appreaciated.
Thanks and have a nice day to all.
Teddy