I have reworked the code a bit so a demo can have multiple screen captures and clean up the code a bit.
But, I am still not happy with this as there are demo's I can't make play nicely, hoping that someone will have some insights/ideas on how to improve on this.
- aui.notebook - screen is not correctly sized before capture is done
- aboutbox - How to capture a modal dialog, which I think this basically is
- agw.aui - need to make the MDIAUI demo a bit nicer
- agw.ballontip - haven't figured out how to show a tip
Attached is a patch file with for a few demo files (check out from this morning) and the script to do the capture.
The capture script assumes to be in a new folder "tools" in the demo folder, if it is elsewhere it needs adjustment. The screen captures will be written to "demo/tools/screencaptures", which will be created if it doesn't exist.
Each demo will need to get a "runScreenCapture" method, with is similar to the existing "runTest". Sometimes the way the demo is written needs to be adjusted, e.g. move the stuff from the 'button' handler into a 'doButton' method. The few patches to demo files included show the basics.
If someone has some better ideas on how to adjust the demo files to be able to capture the screen I am all ears!
Werner
P.S. If someone want to play with this on Linux and/or Mac that would be great.
P.S. Note that I have problems running it within a VM, i.e. the screen shots are messed up when I did run it in Win7 which was in an Ubuntu VirtualBox VM.
sampledemopatches.patch (5.32 KB)
demoscreencapture.py (6.11 KB)