diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-01-04 18:53:28 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-01-04 18:53:28 (GMT) |
commit | d6d63f543796c48fd9a1f297b860287443687d2e (patch) | |
tree | 63875b35c0fc3f1e7280dce75cb12c052915ce69 /Demo/tix/samples/CmpImg.py | |
parent | 6cb2bddb85d2cdc16c214b35d795fb60840bcc67 (diff) | |
download | cpython-d6d63f543796c48fd9a1f297b860287443687d2e.zip cpython-d6d63f543796c48fd9a1f297b860287443687d2e.tar.gz cpython-d6d63f543796c48fd9a1f297b860287443687d2e.tar.bz2 |
fix a lot of Tkinter imports
Diffstat (limited to 'Demo/tix/samples/CmpImg.py')
-rwxr-xr-x | Demo/tix/samples/CmpImg.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Demo/tix/samples/CmpImg.py b/Demo/tix/samples/CmpImg.py index 4720a10..ad49181 100755 --- a/Demo/tix/samples/CmpImg.py +++ b/Demo/tix/samples/CmpImg.py @@ -15,7 +15,7 @@ # buttons # -import Tix +import tkinter.tix network_pixmap = """/* XPM */ static char * netw_xpm[] = { @@ -144,15 +144,15 @@ static unsigned char drivea_bits[] = { """ def RunSample(w): - w.img0 = Tix.Image('pixmap', data=network_pixmap) + w.img0 = tkinter.tix.Image('pixmap', data=network_pixmap) if not w.img0: - w.img0 = Tix.Image('bitmap', data=network_bitmap) - w.img1 = Tix.Image('pixmap', data=hard_disk_pixmap) + w.img0 = tkinter.tix.Image('bitmap', data=network_bitmap) + w.img1 = tkinter.tix.Image('pixmap', data=hard_disk_pixmap) if not w.img0: - w.img1 = Tix.Image('bitmap', data=hard_disk_bitmap) + w.img1 = tkinter.tix.Image('bitmap', data=hard_disk_bitmap) - hdd = Tix.Button(w, padx=4, pady=1, width=120) - net = Tix.Button(w, padx=4, pady=1, width=120) + hdd = tkinter.tix.Button(w, padx=4, pady=1, width=120) + net = tkinter.tix.Button(w, padx=4, pady=1, width=120) # Create the first image: we create a line, then put a string, # a space and a image into this line, from left to right. @@ -160,7 +160,7 @@ def RunSample(w): # individual items # # The tk.calls should be methods in Tix ... - w.hdd_img = Tix.Image('compound', window=hdd) + w.hdd_img = tkinter.tix.Image('compound', window=hdd) w.hdd_img.tk.call(str(w.hdd_img), 'add', 'line') w.hdd_img.tk.call(str(w.hdd_img), 'add', 'text', '-text', 'Hard Disk', '-underline', '0') @@ -172,7 +172,7 @@ def RunSample(w): hdd['image'] = w.hdd_img # Next button - w.net_img = Tix.Image('compound', window=net) + w.net_img = tkinter.tix.Image('compound', window=net) w.net_img.tk.call(str(w.net_img), 'add', 'line') w.net_img.tk.call(str(w.net_img), 'add', 'text', '-text', 'Network', '-underline', '0') @@ -183,14 +183,14 @@ def RunSample(w): # net['image'] = w.net_img - close = Tix.Button(w, pady=1, text='Close', + close = tkinter.tix.Button(w, pady=1, text='Close', command=lambda w=w: w.destroy()) - hdd.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1) - net.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1) - close.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1) + hdd.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1) + net.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1) + close.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1) if __name__ == '__main__': - root = Tix.Tk() + root = tkinter.tix.Tk() RunSample(root) root.mainloop() |