diff options
author | Guido van Rossum <guido@python.org> | 1996-07-30 18:57:18 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-07-30 18:57:18 (GMT) |
commit | 89cb67bb642ee958d9f095728c99e943e994ca54 (patch) | |
tree | 24f176f21636ab7b3a5cd1cec9948b4e3a1315ff /Demo/tkinter/guido/electrons.py | |
parent | c30e95f4b0fa266df678fe4e307ff6c19a3f9e73 (diff) | |
download | cpython-89cb67bb642ee958d9f095728c99e943e994ca54.zip cpython-89cb67bb642ee958d9f095728c99e943e994ca54.tar.gz cpython-89cb67bb642ee958d9f095728c99e943e994ca54.tar.bz2 |
Updated for Python 1.4
Diffstat (limited to 'Demo/tkinter/guido/electrons.py')
-rwxr-xr-x | Demo/tkinter/guido/electrons.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Demo/tkinter/guido/electrons.py b/Demo/tkinter/guido/electrons.py index 5f6c8b5..7296955 100755 --- a/Demo/tkinter/guido/electrons.py +++ b/Demo/tkinter/guido/electrons.py @@ -15,7 +15,6 @@ from Tkinter import * - # The graphical interface class Electrons: @@ -30,14 +29,13 @@ class Electrons: # Add background bitmap if bitmap: self.bitmap = c.create_bitmap(width/2, height/2, - {'bitmap': bitmap, - 'foreground': 'blue'}) + bitmap=bitmap, + foreground='blue') self.pieces = {} x1, y1, x2, y2 = 10,70,14,74 for i in range(n,0,-1): - p = c.create_oval(x1, y1, x2, y2, - {'fill': 'red'}) + p = c.create_oval(x1, y1, x2, y2, fill='red') self.pieces[i] = p y1, y2 = y1 +2, y2 + 2 self.tk.update() @@ -51,11 +49,12 @@ class Electrons: y = rand.choice(range(-3,4)) c.move(p, x, y) self.tk.update() + # Run -- never returns def run(self): while 1: self.random_move(self.n) - self.tk.mainloop() # Hang around... + # Main program def main(): |