Hi, On 15/06/2013 22:23, Helen Craigman wrote:
Dear esteemed WxPerl experts and users: I have been trying to incorprate a validator on a TextCtrl widget, using PlValidator (following this:
......
This gives the error: "Can't call method "SetValue" on an undefined value at..." etc.
As far as my own usage is concerned, classes derived from Wx::PlValidator work perfectly.
For me to either help you to get your Wx::PlValidator derived class working, or identify some bug in Wx::PlValidator, you would have to post some code that can be run and demonstrates the failure you are experiencing.
The code snippet you have posted doesn't show a validator being assigned to a Wx::TextCtrl - so it cannot be an accurate representation of the code that fails for you. You clearly have worked out how a Validator should work if you get as far as the error reported, and you probably just need a simple adjustment in your code to make it work. But without seeing the actual failing code I have no clue what might be causing the failure.
I feel that I am always giving negative answers to the Wx questions you ask on this list and Perl Mongers - and I feel really bad about this as you have clearly figured out 99% of what is required yourself.
I can't help if you don't post some actual code - or even a snippet taken from actual code. I'd guess you are missing a Clone method in your derived class, but who knows. The code you posted can't be the code you are running.
Regards Mark