On Jul 25, 2008, at 1:20 PM, Mattia Barbon wrote:
You can't reliably do it from inside wxWidgets; you could create a wxKeyEvent and send it through ->ProcessEvent, but this only tests the wxWidgets part of the program, all system side effects will not happen (still, it might be better than nothing). http://sourceforge.net/projects/wxguitest/ it's C++-only; when I looked at it it seemed interesting, but I never got round trying it. Mattia
wxGuiTesting is indeed C++ only. In the current release it does something like what you suggest above, creating wxEvents and feeding them to wxPostEvent(). It doesn't generally use wxKeyEvents or wxMouseEvents, though: It mostly posts the resulting wxCommandEvent (e.g., a button press, a menu selection, or a text updated).
I should also point out that it's completely dependent on CppUnit for its test code, which makes it pretty useless for other bindings like Perl.
I'm presently working on extending it (as my time allows -- it's going *really* slowly) to work with native key-press and mouse-click events. I'll announce on wxDev when I've done that and built a new release.
Regards, John Ralls