Just discovered wxIntCtrl and would like to use it, but I need a custom validator to get/set data from a database.
With the standard wxTextCtrl I figured out how this works (with help from Javier), can someone point me in the right direction on how to go about it with wxIntCtrl.
I believe I will need to do at least the following:
- Create a "class intVal(wxIntValidator)", in which I override (is this the correct term) functions "Clone", "TransferToWindow", "TransferFromWindow" and "__init__".
Any hints or even better a little sample code will be much appreciated.
Just discovered wxIntCtrl and would like to use it, but I need a custom validator to get/set data from a database.
With the standard wxTextCtrl I figured out how this works (with help from Javier), can someone point me in the right direction on how to go about it with wxIntCtrl.
I believe I will need to do at least the following:
- Create a "class intVal(wxIntValidator)", in which I override (is this the correct term) functions "Clone", "TransferToWindow", "TransferFromWindow" and "__init__".
Only wxPyValidator is instrumented to be derived from in Python, but you should be able to make your own wxIntCtrl-specific validator from it just as easily as the others.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Please bear with me. With the textctrl I could just state the keywork validator, when I tried this with intctrl I get an unexpected keyword argument error. So, I looked at lib.intctrl and saw that there is a wxIntValidator, that is why I thought/guessed that I should derive my validator from it.
Frankly this is why above my head, I am not at all sure how to go about this without loosing the functionality of wxIntValidator.
Any help/hints, or even better some code snipped would be much appreciated.
Best regards
Werner
Robin Dunn wrote:
···
Werner F. Bruhin wrote:
Just discovered wxIntCtrl and would like to use it, but I need a custom validator to get/set data from a database.
With the standard wxTextCtrl I figured out how this works (with help from Javier), can someone point me in the right direction on how to go about it with wxIntCtrl.
I believe I will need to do at least the following:
- Create a "class intVal(wxIntValidator)", in which I override (is this the correct term) functions "Clone", "TransferToWindow", "TransferFromWindow" and "__init__".
Only wxPyValidator is instrumented to be derived from in Python, but you should be able to make your own wxIntCtrl-specific validator from it just as easily as the others.
Please bear with me. With the textctrl I could just state the keywork validator, when I tried this with intctrl I get an unexpected keyword argument error.
Sorry, I didn't make the mental connection between your message and the wxIntCtrl in the library. I see Will has already fixed things...
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
BTW, the more I work with Python and wxPython the more I like it, and this is in large parts due to support provided by people like yourself. - THANKS!
See you
Werner
Robin Dunn wrote:
···
Werner F. Bruhin wrote:
Robin,
Please bear with me. With the textctrl I could just state the keywork validator, when I tried this with intctrl I get an unexpected keyword argument error.
Sorry, I didn't make the mental connection between your message and the wxIntCtrl in the library. I see Will has already fixed things...