[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版

(yzsuai) #1

Example 11-8. PP4E\Gui\MovingPics\movingpics.py


"""
##############################################################################
PyDraw 1.1: simple canvas paint program and object mover/animator.


Uses time.sleep loops to implement object move loops, such that only
one move can be in progress at once; this is smooth and fast, but see
the widget.after and thread-based subclasses here for other techniques.
Version 1.1 has been updated to run under Python 3.X (2.X not supported)
##############################################################################
"""


helpstr = """--PyDraw version 1.1--
Mouse commands:
Left = Set target spot
Left+Move = Draw new object
Double Left = Clear all objects
Right = Move current object
Middle = Select closest object
Middle+Move = Drag current object


Figure 11-17. PyDraw with draw objects ready to be moved


PyDraw: Painting and Moving Graphics| 739
Free download pdf