Hi all, <br>
<br>
Just working on some validators for text fields, and I started getting unusual errors - <br>
<br>
&nbsp; File &quot;C:\Python23\lib\site-packages\PythonCard\components\textfield.py&quot;, line 338, in _dispatch<br>
&nbsp;&nbsp;&nbsp; widget.Widget._dispatch(self, aWxEvent)<br>
&nbsp; File &quot;C:\Python23\lib\site-packages\PythonCard\widget.py&quot;, line 402, in _dispatch<br>
&nbsp;&nbsp;&nbsp; handler(background, aWxEvent)<br>
&nbsp; File &quot;C:\Python23\SEDB\generic.py&quot;, line 53, in on_keyPress<br>
&nbsp;&nbsp;&nbsp; elif len(eventSourceWidget.text) &gt;=
self.restrictions[<a href="http://eventSourceWidget.name">eventSourceWidget.name</a>]['length']&nbsp; or not
self.isOK(<a href="http://eventSourceWidget.name">eventSourceWidget.name</a>, event.keyCode):<br>
&nbsp; File &quot;C:\Python23\SEDB\generic.py&quot;, line 69, in isOK<br>
&nbsp;&nbsp;&nbsp; xR = self.integerRE.search(chr(keyCode))<br>
ValueError: chr() arg not in range(256)<br><br>
(And yes, I know wxPython has validators already, I was 90% through
mine when I found them, and so I'll finish off the last 10% out of
stubborn pride.)<br>
<br>
For the life of me, I couldn't figure out what was happening, so I stuck in a try clause. <br>
<br>
*******<br>
Oops<br>
keyCode = 333<br>
Widget = dateBooked<br>
*******<br>
<br>
*******<br>
Oops<br>
keyCode = 332<br>
Widget = dateBooked<br>
*******<br>
<br>
I was entering numeric data, and as I do a lot of data entry at work,
by default I use the numeric keypad, so I guess I just found that
extended ASCII stuff. Is there a easy way around this with chr()?<br>
<br>
Or is it a case of making my own keycode to character dictionary? I'm feeling lazy at the moment.<br>
<br>
Regards, <br>
<br>
<br>
Liam Clarke<br>
<br>-- <br>'There is only one basic human right, and that is to do as you damn well please.<br>And with it comes the only basic human duty, to take the consequences.