~bennabiy/+junk/python-xlib

« back to all changes in this revision

Viewing changes to examples/draw.py

  • Committer: Package Import Robot
  • Author(s): Andrew Shadura, Ramkumar Ramachandra, Andrew Shadura
  • Date: 2015-08-13 08:14:19 UTC
  • mfrom: (6.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20150813081419-hdefinnghp2iydkx
Tags: 0.14+20091101-3
[ Ramkumar Ramachandra ]
* Remove useless debugging output (Closes: #565996)

[ Andrew Shadura ]
* Switch to 3.0 (quilt) format.
* Rename patches.
* Use debhelper 9 in its short form.
* Use pybuild.
* Bump Standards-Version.
* Don't build or install PostScript documentation and info files.
* Use system-provided texi2html instead of a shipped version
  (Closes: #795057).
* Update debian/copyright (Closes: #795057).
* Don't install Makefile or texi2html with the documentation.
* Set executable bit for examples.

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
                        sys.exit(0)
116
116
 
117
117
# A drawed objects, consisting of either a single
118
 
# romboid, or two romboids connected by a winding line
 
118
# rhomboid, or two rhomboids connected by a winding line
119
119
 
120
120
class Movement:
121
121
    def __init__(self, win, ev):
129
129
        self.time = ev.time
130
130
        self.lines = [(ev.event_x, ev.event_y)]
131
131
 
132
 
        self.first = Romboid(self.win, ev)
 
132
        self.first = Rhomboid(self.win, ev)
133
133
        self.last = None
134
134
 
135
135
    def motion(self, ev):
182
182
    def finish(self, ev):
183
183
        self.motion(ev)
184
184
        if len(self.lines) > 1:
185
 
            self.last = Romboid(self.win, ev)
 
185
            self.last = Rhomboid(self.win, ev)
186
186
 
187
187
            self.left = min(ev.event_x - 5, self.left)
188
188
            self.right = max(ev.event_x + 5, self.right)
204
204
                self.last.draw()
205
205
 
206
206
 
207
 
# A romboid, drawed around the Movement endpoints
208
 
class Romboid:
 
207
# A rhomboid, drawed around the Movement endpoints
 
208
class Rhomboid:
209
209
    def __init__(self, win, ev):
210
210
        self.win = win
211
211
        self.x = ev.event_x
213
213
        self.draw()
214
214
 
215
215
    def draw(self):
216
 
        # Draw the segments of the romboid
 
216
        # Draw the segments of the rhomboid
217
217
        self.win.window.poly_line(self.win.gc, X.CoordModePrevious,
218
218
                                  [(self.x, self.y - 5),
219
219
                                   (5, 5),