Hi,
I have been playing with wxPython for a while, and am about to start using it for serious development. I have only just subscribed to this list, so my apologies if this is an FAQ.
I have been heavily influenced by Extreme Programming, and would like use test driven development via the unittest module in the Python library. At the moment there does not seem to be a standard way of driving wxPython GUI objects from code, so I am considering writing a framework for it. This would emulate user interactions by creating fake wxCommandEvent objects and sending them to the relevant control.
My questions are:
1) has anyone done anything like this already? I would rather not have to reinvent the wheel.
2) is it feasible? The wxCommandEvent objects are normally generated by the system, so is it possible to generate them from within the python code? I did a search in the mailing list on the subject, and there was a discussion a while ago that said the eventType codes are dynamically generated, so how do I know what to set the eventType to? What about the other data fields - is there any documentation about what needs to be filled in, or do I have to go through the C++ source for each event? This is probably not much of an issue for simple events, but the more complex events such as wxTreeEvent look like they may be tricky.
3) is there an alternative way to drive the GUI programatically that I have missed? I have written a Python COM interface to ActiveAccessibility which I can use for driving MFC based programs, so when wxWindows supports ActiveAccessibility that is a possible alternative. Unfortunately the rights to that are held by the company I was working for at the time, so I can't make it open source. It is also limited to the Windows platform, while the wxCommandEvent solution would be cross platform.
Regards,
Dave Kirby - The Developers' Coach
Helping software professionals and teams achieve peak performance
email: dave@thedeveloperscoach.com
UK Phone: 020 8376 2274
International Phone: (+44) 20 8376 2274
web: http://www.thedeveloperscoach.com - sign up for my new free eZine, The Agile Life