/Demo/turtle/demohelp.txt

http://unladen-swallow.googlecode.com/ · Plain Text · 75 lines · 49 code · 26 blank · 0 comment · 0 complexity · 31ae2aaf6236f29c47f0c801edb51bf7 MD5 · raw file

  1. ----------------------------------------------
  2. xturtleDemo - Help
  3. ----------------------------------------------
  4. This document has two sections:
  5. (1) How to use the demo viewer
  6. (2) How to add your own demos to the demo repository
  7. (1) How to use the demo viewer.
  8. Select a demoscript from the example menu.
  9. The (syntax coloured) source code appears in the left
  10. source code window. IT CANNOT BE EDITED, but ONLY VIEWED!
  11. - Press START button to start the demo.
  12. - Stop execution by pressing the STOP button.
  13. - Clear screen by pressing the CLEAR button.
  14. - Restart by pressing the START button again.
  15. SPECIAL demos are those which run EVENTDRIVEN.
  16. (For example clock.py - or oldTurtleDemo.py which
  17. in the end expects a mouse click.):
  18. Press START button to start the demo.
  19. - Until the EVENTLOOP is entered everything works
  20. as in an ordinary demo script.
  21. - When the EVENTLOOP is entered, you control the
  22. application by using the mouse and/or keys (or it's
  23. controlled by some timer events)
  24. To stop it you can and must press the STOP button.
  25. While the EVENTLOOP is running, the examples menu is disabled.
  26. - Only after having pressed the STOP button, you may
  27. restart it or choose another example script.
  28. * * * * * * * *
  29. In some rare situations there may occur interferences/conflicts
  30. between events concerning the demo script and those concerning the
  31. demo-viewer. (They run in the same process.) Strange behaviour may be
  32. the consequence and in the worst case you must close and restart the
  33. viewer.
  34. * * * * * * * *
  35. (2) How to add your own demos to the demo repository
  36. - scriptname: must begin with tdemo_ ,
  37. so it must have the form tdemo_<your-script-name>.py
  38. - place: same directory as xturtleDemo.py or some
  39. subdirectory, the name of which must also begin with
  40. tdemo_.....
  41. - requirements on source code:
  42. code must contain a main() function which will
  43. be executed by the viewer (see provided example scripts)
  44. main() may return a string which will be displayed
  45. in the Label below the source code window (when execution
  46. has finished.)
  47. !! For programs, which are EVENT DRIVEN, main must return
  48. !! the string "EVENTLOOP". This informs the viewer, that the
  49. !! script is still running and must be stopped by the user!