Commit d6d63f54 authored by Benjamin Peterson's avatar Benjamin Peterson

fix a lot of Tkinter imports

parent 6cb2bddb
### ###
import Tix as tk import tkinter.tix as tk
from pprint import pprint from pprint import pprint
r= tk.Tk() r= tk.Tk()
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
# Your can display the help message in a "balloon" and a status bar widget. # Your can display the help message in a "balloon" and a status bar widget.
# #
import Tix import tkinter.tix
TCL_ALL_EVENTS = 0 TCL_ALL_EVENTS = 0
...@@ -32,20 +32,20 @@ class DemoBalloon: ...@@ -32,20 +32,20 @@ class DemoBalloon:
z = w.winfo_toplevel() z = w.winfo_toplevel()
z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd()) z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
status = Tix.Label(w, width=40, relief=Tix.SUNKEN, bd=1) status = tkinter.tix.Label(w, width=40, relief=tkinter.tix.SUNKEN, bd=1)
status.pack(side=Tix.BOTTOM, fill=Tix.Y, padx=2, pady=1) status.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.Y, padx=2, pady=1)
# Create two mysterious widgets that need balloon help # Create two mysterious widgets that need balloon help
button1 = Tix.Button(w, text='Something Unexpected', button1 = tkinter.tix.Button(w, text='Something Unexpected',
command=self.quitcmd) command=self.quitcmd)
button2 = Tix.Button(w, text='Something Else Unexpected') button2 = tkinter.tix.Button(w, text='Something Else Unexpected')
button2['command'] = lambda w=button2: w.destroy() button2['command'] = lambda w=button2: w.destroy()
button1.pack(side=Tix.TOP, expand=1) button1.pack(side=tkinter.tix.TOP, expand=1)
button2.pack(side=Tix.TOP, expand=1) button2.pack(side=tkinter.tix.TOP, expand=1)
# Create the balloon widget and associate it with the widgets that we want # Create the balloon widget and associate it with the widgets that we want
# to provide tips for: # to provide tips for:
b = Tix.Balloon(w, statusbar=status) b = tkinter.tix.Balloon(w, statusbar=status)
b.bind_widget(button1, balloonmsg='Close Window', b.bind_widget(button1, balloonmsg='Close Window',
statusmsg='Press this button to close this window') statusmsg='Press this button to close this window')
...@@ -64,5 +64,5 @@ class DemoBalloon: ...@@ -64,5 +64,5 @@ class DemoBalloon:
self.root.destroy() self.root.destroy()
if __name__ == '__main__': if __name__ == '__main__':
root = Tix.Tk() root = tkinter.tix.Tk()
RunSample(root) RunSample(root)
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
# for example. # for example.
# #
import Tix import tkinter.tix
def RunSample(w): def RunSample(w):
# Create the label on the top of the dialog box # Create the label on the top of the dialog box
# #
top = Tix.Label(w, padx=20, pady=10, bd=1, relief=Tix.RAISED, top = tkinter.tix.Label(w, padx=20, pady=10, bd=1, relief=tkinter.tix.RAISED,
anchor=Tix.CENTER, text='This dialog box is\n a demonstration of the\n tixButtonBox widget') anchor=tkinter.tix.CENTER, text='This dialog box is\n a demonstration of the\n tixButtonBox widget')
# Create the button box and add a few buttons in it. Set the # Create the button box and add a few buttons in it. Set the
# -width of all the buttons to the same value so that they # -width of all the buttons to the same value so that they
...@@ -30,15 +30,15 @@ def RunSample(w): ...@@ -30,15 +30,15 @@ def RunSample(w):
# Note that the -text, -underline, -command and -width options are all # Note that the -text, -underline, -command and -width options are all
# standard options of the button widgets. # standard options of the button widgets.
# #
box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
box.add('ok', text='OK', underline=0, width=5, box.add('ok', text='OK', underline=0, width=5,
command=lambda w=w: w.destroy()) command=lambda w=w: w.destroy())
box.add('close', text='Cancel', underline=0, width=5, box.add('close', text='Cancel', underline=0, width=5,
command=lambda w=w: w.destroy()) command=lambda w=w: w.destroy())
box.pack(side=Tix.BOTTOM, fill=Tix.X) box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
if __name__ == '__main__': if __name__ == '__main__':
root = Tix.Tk() root = tkinter.tix.Tk()
RunSample(root) RunSample(root)
root.mainloop() root.mainloop()
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
# buttons # buttons
# #
import Tix import tkinter.tix
network_pixmap = """/* XPM */ network_pixmap = """/* XPM */
static char * netw_xpm[] = { static char * netw_xpm[] = {
...@@ -144,15 +144,15 @@ static unsigned char drivea_bits[] = { ...@@ -144,15 +144,15 @@ static unsigned char drivea_bits[] = {
""" """
def RunSample(w): def RunSample(w):
w.img0 = Tix.Image('pixmap', data=network_pixmap) w.img0 = tkinter.tix.Image('pixmap', data=network_pixmap)
if not w.img0: if not w.img0:
w.img0 = Tix.Image('bitmap', data=network_bitmap) w.img0 = tkinter.tix.Image('bitmap', data=network_bitmap)
w.img1 = Tix.Image('pixmap', data=hard_disk_pixmap) w.img1 = tkinter.tix.Image('pixmap', data=hard_disk_pixmap)
if not w.img0: 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) hdd = tkinter.tix.Button(w, padx=4, pady=1, width=120)
net = 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, # Create the first image: we create a line, then put a string,
# a space and a image into this line, from left to right. # a space and a image into this line, from left to right.
...@@ -160,7 +160,7 @@ def RunSample(w): ...@@ -160,7 +160,7 @@ def RunSample(w):
# individual items # individual items
# #
# The tk.calls should be methods in Tix ... # 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', 'line')
w.hdd_img.tk.call(str(w.hdd_img), 'add', 'text', '-text', 'Hard Disk', w.hdd_img.tk.call(str(w.hdd_img), 'add', 'text', '-text', 'Hard Disk',
'-underline', '0') '-underline', '0')
...@@ -172,7 +172,7 @@ def RunSample(w): ...@@ -172,7 +172,7 @@ def RunSample(w):
hdd['image'] = w.hdd_img hdd['image'] = w.hdd_img
# Next button # 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', 'line')
w.net_img.tk.call(str(w.net_img), 'add', 'text', '-text', 'Network', w.net_img.tk.call(str(w.net_img), 'add', 'text', '-text', 'Network',
'-underline', '0') '-underline', '0')
...@@ -183,14 +183,14 @@ def RunSample(w): ...@@ -183,14 +183,14 @@ def RunSample(w):
# #
net['image'] = w.net_img 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()) command=lambda w=w: w.destroy())
hdd.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=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1) net.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1)
close.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1) close.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1)
if __name__ == '__main__': if __name__ == '__main__':
root = Tix.Tk() root = tkinter.tix.Tk()
RunSample(root) RunSample(root)
root.mainloop() root.mainloop()
...@@ -13,15 +13,15 @@ ...@@ -13,15 +13,15 @@
# This file demonstrates the use of the tixComboBox widget, which is close # This file demonstrates the use of the tixComboBox widget, which is close
# to the MS Window Combo Box control. # to the MS Window Combo Box control.
# #
import Tix import tkinter.tix
def RunSample(w): def RunSample(w):
global demo_month, demo_year global demo_month, demo_year
top = Tix.Frame(w, bd=1, relief=Tix.RAISED) top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED)
demo_month = Tix.StringVar() demo_month = tkinter.tix.StringVar()
demo_year = Tix.StringVar() demo_year = tkinter.tix.StringVar()
# $w.top.a is a drop-down combo box. It is not editable -- who wants # $w.top.a is a drop-down combo box. It is not editable -- who wants
# to invent new months? # to invent new months?
...@@ -30,7 +30,7 @@ def RunSample(w): ...@@ -30,7 +30,7 @@ def RunSample(w):
# [Hint] We set the label.width subwidget option of both comboboxes to # [Hint] We set the label.width subwidget option of both comboboxes to
# be 10 so that their labels appear to be aligned. # be 10 so that their labels appear to be aligned.
# #
a = Tix.ComboBox(top, label="Month: ", dropdown=1, a = tkinter.tix.ComboBox(top, label="Month: ", dropdown=1,
command=select_month, editable=0, variable=demo_month, command=select_month, editable=0, variable=demo_month,
options='listbox.height 6 label.width 10 label.anchor e') options='listbox.height 6 label.width 10 label.anchor e')
...@@ -43,31 +43,31 @@ def RunSample(w): ...@@ -43,31 +43,31 @@ def RunSample(w):
# [Hint] Notice that you should use padY (the NAME of the option) and not # [Hint] Notice that you should use padY (the NAME of the option) and not
# pady (the SWITCH of the option). # pady (the SWITCH of the option).
# #
b = Tix.ComboBox(top, label="Year: ", dropdown=0, b = tkinter.tix.ComboBox(top, label="Year: ", dropdown=0,
command=select_year, editable=1, variable=demo_year, command=select_year, editable=1, variable=demo_year,
options='listbox.height 4 label.padY 5 label.width 10 label.anchor ne') options='listbox.height 4 label.padY 5 label.width 10 label.anchor ne')
a.pack(side=Tix.TOP, anchor=Tix.W) a.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W)
b.pack(side=Tix.TOP, anchor=Tix.W) b.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W)
a.insert(Tix.END, 'January') a.insert(tkinter.tix.END, 'January')
a.insert(Tix.END, 'February') a.insert(tkinter.tix.END, 'February')
a.insert(Tix.END, 'March') a.insert(tkinter.tix.END, 'March')
a.insert(Tix.END, 'April') a.insert(tkinter.tix.END, 'April')
a.insert(Tix.END, 'May') a.insert(tkinter.tix.END, 'May')
a.insert(Tix.END, 'June') a.insert(tkinter.tix.END, 'June')
a.insert(Tix.END, 'July') a.insert(tkinter.tix.END, 'July')
a.insert(Tix.END, 'August') a.insert(tkinter.tix.END, 'August')
a.insert(Tix.END, 'September') a.insert(tkinter.tix.END, 'September')
a.insert(Tix.END, 'October') a.insert(tkinter.tix.END, 'October')
a.insert(Tix.END, 'November') a.insert(tkinter.tix.END, 'November')
a.insert(Tix.END, 'December') a.insert(tkinter.tix.END, 'December')
b.insert(Tix.END, '1992') b.insert(tkinter.tix.END, '1992')
b.insert(Tix.END, '1993') b.insert(tkinter.tix.END, '1993')
b.insert(Tix.END, '1994') b.insert(tkinter.tix.END, '1994')
b.insert(Tix.END, '1995') b.insert(tkinter.tix.END, '1995')
b.insert(Tix.END, '1996') b.insert(tkinter.tix.END, '1996')
# Use "tixSetSilent" to set the values of the combo box if you # Use "tixSetSilent" to set the values of the combo box if you
# don't want your -command procedures (cbx:select_month and # don't want your -command procedures (cbx:select_month and
...@@ -76,13 +76,13 @@ def RunSample(w): ...@@ -76,13 +76,13 @@ def RunSample(w):
a.set_silent('January') a.set_silent('January')
b.set_silent('1995') b.set_silent('1995')
box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
box.add('ok', text='Ok', underline=0, width=6, box.add('ok', text='Ok', underline=0, width=6,
command=lambda w=w: ok_command(w)) command=lambda w=w: ok_command(w))
box.add('cancel', text='Cancel', underline=0, width=6, box.add('cancel', text='Cancel', underline=0, width=6,
command=lambda w=w: w.destroy()) command=lambda w=w: w.destroy())
box.pack(side=Tix.BOTTOM, fill=Tix.X) box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
def select_month(event=None): def select_month(event=None):
# tixDemo:Status "Month = %s" % demo_month.get() # tixDemo:Status "Month = %s" % demo_month.get()
...@@ -97,6 +97,6 @@ def ok_command(w): ...@@ -97,6 +97,6 @@ def ok_command(w):
w.destroy() w.destroy()
if __name__ == '__main__': if __name__ == '__main__':
root = Tix.Tk() root = tkinter.tix.Tk()
RunSample(root) RunSample(root)
root.mainloop() root.mainloop()
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
# integer values; one lets you select floating point values and the last # integer values; one lets you select floating point values and the last
# one lets you select a few names. # one lets you select a few names.
import Tix import tkinter.tix
TCL_ALL_EVENTS = 0 TCL_ALL_EVENTS = 0
...@@ -34,14 +34,14 @@ class DemoControl: ...@@ -34,14 +34,14 @@ class DemoControl:
global demo_maker, demo_thrust, demo_num_engines global demo_maker, demo_thrust, demo_num_engines
demo_maker = Tix.StringVar() demo_maker = tkinter.tix.StringVar()
demo_thrust = Tix.DoubleVar() demo_thrust = tkinter.tix.DoubleVar()
demo_num_engines = Tix.IntVar() demo_num_engines = tkinter.tix.IntVar()
demo_maker.set('P&W') demo_maker.set('P&W')
demo_thrust.set(20000.0) demo_thrust.set(20000.0)
demo_num_engines.set(2) demo_num_engines.set(2)
top = Tix.Frame(w, bd=1, relief=Tix.RAISED) top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED)
# $w.top.a allows only integer values # $w.top.a allows only integer values
# #
...@@ -49,16 +49,16 @@ class DemoControl: ...@@ -49,16 +49,16 @@ class DemoControl:
# [Hint] We set the label.width subwidget option of the Controls to # [Hint] We set the label.width subwidget option of the Controls to
# be 16 so that their labels appear to be aligned. # be 16 so that their labels appear to be aligned.
# #
a = Tix.Control(top, label='Number of Engines: ', integer=1, a = tkinter.tix.Control(top, label='Number of Engines: ', integer=1,
variable=demo_num_engines, min=1, max=4, variable=demo_num_engines, min=1, max=4,
options='entry.width 10 label.width 20 label.anchor e') options='entry.width 10 label.width 20 label.anchor e')
b = Tix.Control(top, label='Thrust: ', integer=0, b = tkinter.tix.Control(top, label='Thrust: ', integer=0,
min='10000.0', max='60000.0', step=500, min='10000.0', max='60000.0', step=500,
variable=demo_thrust, variable=demo_thrust,
options='entry.width 10 label.width 20 label.anchor e') options='entry.width 10 label.width 20 label.anchor e')
c = Tix.Control(top, label='Engine Maker: ', value='P&W', c = tkinter.tix.Control(top, label='Engine Maker: ', value='P&W',
variable=demo_maker, variable=demo_maker,
options='entry.width 10 label.width 20 label.anchor e') options='entry.width 10 label.width 20 label.anchor e')
...@@ -68,17 +68,17 @@ class DemoControl: ...@@ -68,17 +68,17 @@ class DemoControl:
c['decrcmd'] = lambda w=c: adjust_maker(w, -1) c['decrcmd'] = lambda w=c: adjust_maker(w, -1)
c['validatecmd'] = lambda w=c: validate_maker(w) c['validatecmd'] = lambda w=c: validate_maker(w)
a.pack(side=Tix.TOP, anchor=Tix.W) a.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W)
b.pack(side=Tix.TOP, anchor=Tix.W) b.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W)
c.pack(side=Tix.TOP, anchor=Tix.W) c.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W)
box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
box.add('ok', text='Ok', underline=0, width=6, box.add('ok', text='Ok', underline=0, width=6,
command=self.okcmd) command=self.okcmd)
box.add('cancel', text='Cancel', underline=0, width=6, box.add('cancel', text='Cancel', underline=0, width=6,
command=self.quitcmd) command=self.quitcmd)
box.pack(side=Tix.BOTTOM, fill=Tix.X) box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
def okcmd (self): def okcmd (self):
# tixDemo:Status "Selected %d of %s engines each of thrust %d", (demo_num_engines.get(), demo_maker.get(), demo_thrust.get()) # tixDemo:Status "Selected %d of %s engines each of thrust %d", (demo_num_engines.get(), demo_maker.get(), demo_thrust.get())
...@@ -118,5 +118,5 @@ def validate_maker(w): ...@@ -118,5 +118,5 @@ def validate_maker(w):
return maker_list[i] return maker_list[i]
if __name__ == '__main__': if __name__ == '__main__':
root = Tix.Tk() root = tkinter.tix.Tk()
RunSample(root) RunSample(root)
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
# installation directory for an application. # installation directory for an application.
# #
import Tix, os, copy import tkinter.tix, os, copy
from Tkconstants import * from tkinter.constants import *
TCL_ALL_EVENTS = 0 TCL_ALL_EVENTS = 0
...@@ -40,25 +40,25 @@ class DemoDirList: ...@@ -40,25 +40,25 @@ class DemoDirList:
# bg = root.tk.eval('tix option get bg') # bg = root.tk.eval('tix option get bg')
# adding bg=bg crashes Windows pythonw tk8.3.3 Python 2.1.0 # adding bg=bg crashes Windows pythonw tk8.3.3 Python 2.1.0
top = Tix.Frame( w, relief=RAISED, bd=1) top = tkinter.tix.Frame( w, relief=RAISED, bd=1)
# Create the DirList widget. By default it will show the current # Create the DirList widget. By default it will show the current
# directory # directory
# #
# #
top.dir = Tix.DirList(top) top.dir = tkinter.tix.DirList(top)
top.dir.hlist['width'] = 40 top.dir.hlist['width'] = 40
# When the user presses the ".." button, the selected directory # When the user presses the ".." button, the selected directory
# is "transferred" into the entry widget # is "transferred" into the entry widget
# #
top.btn = Tix.Button(top, text = " >> ", pady = 0) top.btn = tkinter.tix.Button(top, text = " >> ", pady = 0)
# We use a LabelEntry to hold the installation directory. The user # We use a LabelEntry to hold the installation directory. The user
# can choose from the DirList widget, or he can type in the directory # can choose from the DirList widget, or he can type in the directory
# manually # manually
# #
top.ent = Tix.LabelEntry(top, label="Installation Directory:", top.ent = tkinter.tix.LabelEntry(top, label="Installation Directory:",
labelside = 'top', labelside = 'top',
options = ''' options = '''
entry.width 40 entry.width 40
...@@ -85,7 +85,7 @@ class DemoDirList: ...@@ -85,7 +85,7 @@ class DemoDirList:
# Use a ButtonBox to hold the buttons. # Use a ButtonBox to hold the buttons.
# #
box = Tix.ButtonBox (w, orientation='horizontal') box = tkinter.tix.ButtonBox (w, orientation='horizontal')
box.add ('ok', text='Ok', underline=0, width=6, box.add ('ok', text='Ok', underline=0, width=6,
command = lambda self=self: self.okcmd () ) command = lambda self=self: self.okcmd () )
box.add ('cancel', text='Cancel', underline=0, width=6, box.add ('cancel', text='Cancel', underline=0, width=6,
...@@ -118,14 +118,14 @@ class DemoDirList: ...@@ -118,14 +118,14 @@ class DemoDirList:
# outside of the main demo program "tixwidgets.py". # outside of the main demo program "tixwidgets.py".
# #
if __name__== '__main__' : if __name__== '__main__' :
import tkMessageBox, traceback import tkinter.messagebox, traceback
try: try:
root=Tix.Tk() root=tkinter.tix.Tk()
RunSample(root) RunSample(root)
except: except:
t, v, tb = sys.exc_info() t, v, tb = sys.exc_info()
text = "Error running the demo script:\n" text = "Error running the demo script:\n"
for line in traceback.format_exception(t,v,tb): for line in traceback.format_exception(t,v,tb):
text = text + line + '\n' text = text + line + '\n'
d = tkMessageBox.showerror ( 'Tix Demo Error', text) d = tkinter.messagebox.showerror ( 'Tix Demo Error', text)
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
# installation directory for an application. # installation directory for an application.
# #
import Tix, os, copy import tkinter.tix, os, copy
from Tkconstants import * from tkinter.constants import *
TCL_ALL_EVENTS = 0 TCL_ALL_EVENTS = 0
...@@ -40,25 +40,25 @@ class DemoDirTree: ...@@ -40,25 +40,25 @@ class DemoDirTree:
# bg = root.tk.eval('tix option get bg') # bg = root.tk.eval('tix option get bg')
# adding bg=bg crashes Windows pythonw tk8.3.3 Python 2.1.0 # adding bg=bg crashes Windows pythonw tk8.3.3 Python 2.1.0
top = Tix.Frame( w, relief=RAISED, bd=1) top = tkinter.tix.Frame( w, relief=RAISED, bd=1)
# Create the DirTree widget. By default it will show the current # Create the DirTree widget. By default it will show the current
# directory # directory
# #
# #
top.dir = Tix.DirTree(top) top.dir = tkinter.tix.DirTree(top)
top.dir.hlist['width'] = 40 top.dir.hlist['width'] = 40
# When the user presses the ".." button, the selected directory # When the user presses the ".." button, the selected directory
# is "transferred" into the entry widget # is "transferred" into the entry widget
# #
top.btn = Tix.Button(top, text = " >> ", pady = 0) top.btn = tkinter.tix.Button(top, text = " >> ", pady = 0)
# We use a LabelEntry to hold the installation directory. The user # We use a LabelEntry to hold the installation directory. The user
# can choose from the DirTree widget, or he can type in the directory # can choose from the DirTree widget, or he can type in the directory
# manually # manually
# #
top.ent = Tix.LabelEntry(top, label="Installation Directory:", top.ent = tkinter.tix.LabelEntry(top, label="Installation Directory:",
labelside = 'top', labelside = 'top',
options = ''' options = '''
entry.width 40 entry.width 40
...@@ -79,7 +79,7 @@ class DemoDirTree: ...@@ -79,7 +79,7 @@ class DemoDirTree:
# Use a ButtonBox to hold the buttons. # Use a ButtonBox to hold the buttons.
# #
box = Tix.ButtonBox (w, orientation='horizontal') box = tkinter.tix.ButtonBox (w, orientation='horizontal')
box.add ('ok', text='Ok', underline=0, width=6, box.add ('ok', text='Ok', underline=0, width=6,
command = lambda self=self: self.okcmd () ) command = lambda self=self: self.okcmd () )
box.add ('cancel', text='Cancel', underline=0, width=6, box.add ('cancel', text='Cancel', underline=0, width=6,
...@@ -113,5 +113,5 @@ class DemoDirTree: ...@@ -113,5 +113,5 @@ class DemoDirTree:
# outside of the main demo program "tixwidgets.py". # outside of the main demo program "tixwidgets.py".
# #
if __name__== '__main__' : if __name__== '__main__' :
root=Tix.Tk() root=tkinter.tix.Tk()
RunSample(root) RunSample(root)
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# This file demonstrates the use of the tixNoteBook widget, which allows # This file demonstrates the use of the tixNoteBook widget, which allows
# you to lay out your interface using a "notebook" metaphore # you to lay out your interface using a "notebook" metaphore
# #
import Tix import tkinter.tix
def RunSample(w): def RunSample(w):
global root global root
...@@ -21,20 +21,20 @@ def RunSample(w): ...@@ -21,20 +21,20 @@ def RunSample(w):
# We use these options to set the sizes of the subwidgets inside the # We use these options to set the sizes of the subwidgets inside the
# notebook, so that they are well-aligned on the screen. # notebook, so that they are well-aligned on the screen.
prefix = Tix.OptionName(w) prefix = tkinter.tix.OptionName(w)
if prefix: if prefix:
prefix = '*'+prefix prefix = '*'+prefix
else: else:
prefix = '' prefix = ''
w.option_add(prefix+'*TixControl*entry.width', 10) w.option_add(prefix+'*TixControl*entry.width', 10)
w.option_add(prefix+'*TixControl*label.width', 18) w.option_add(prefix+'*TixControl*label.width', 18)
w.option_add(prefix+'*TixControl*label.anchor', Tix.E) w.option_add(prefix+'*TixControl*label.anchor', tkinter.tix.E)
w.option_add(prefix+'*TixNoteBook*tagPadX', 8) w.option_add(prefix+'*TixNoteBook*tagPadX', 8)
# Create the notebook widget and set its backpagecolor to gray. # Create the notebook widget and set its backpagecolor to gray.
# Note that the -backpagecolor option belongs to the "nbframe" # Note that the -backpagecolor option belongs to the "nbframe"
# subwidget. # subwidget.
nb = Tix.NoteBook(w, name='nb', ipadx=6, ipady=6) nb = tkinter.tix.NoteBook(w, name='nb', ipadx=6, ipady=6)
nb['bg'] = 'gray' nb['bg'] = 'gray'
nb.nbframe['backpagecolor'] = 'gray' nb.nbframe['backpagecolor'] = 'gray'
...@@ -45,7 +45,7 @@ def RunSample(w): ...@@ -45,7 +45,7 @@ def RunSample(w):
nb.add('hard_disk', label="Hard Disk", underline=0) nb.add('hard_disk', label="Hard Disk", underline=0)
nb.add('network', label="Network", underline=0) nb.add('network', label="Network", underline=0)
nb.pack(expand=1, fill=Tix.BOTH, padx=5, pady=5 ,side=Tix.TOP) nb.pack(expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5 ,side=tkinter.tix.TOP)
#---------------------------------------- #----------------------------------------
# Create the first page # Create the first page
...@@ -54,21 +54,21 @@ def RunSample(w): ...@@ -54,21 +54,21 @@ def RunSample(w):
# other widgets # other widgets
# #
tab=nb.hard_disk tab=nb.hard_disk
f = Tix.Frame(tab) f = tkinter.tix.Frame(tab)
common = Tix.Frame(tab) common = tkinter.tix.Frame(tab)
f.pack(side=Tix.LEFT, padx=2, pady=2, fill=Tix.BOTH, expand=1) f.pack(side=tkinter.tix.LEFT, padx=2, pady=2, fill=tkinter.tix.BOTH, expand=1)
common.pack(side=Tix.RIGHT, padx=2, fill=Tix.Y) common.pack(side=tkinter.tix.RIGHT, padx=2, fill=tkinter.tix.Y)
a = Tix.Control(f, value=12, label='Access time: ') a = tkinter.tix.Control(f, value=12, label='Access time: ')
w = Tix.Control(f, value=400, label='Write Throughput: ') w = tkinter.tix.Control(f, value=400, label='Write Throughput: ')
r = Tix.Control(f, value=400, label='Read Throughput: ') r = tkinter.tix.Control(f, value=400, label='Read Throughput: ')
c = Tix.Control(f, value=1021, label='Capacity: ') c = tkinter.tix.Control(f, value=1021, label='Capacity: ')
a.pack(side=Tix.TOP, padx=20, pady=2) a.pack(side=tkinter.tix.TOP, padx=20, pady=2)
w.pack(side=Tix.TOP, padx=20, pady=2) w.pack(side=tkinter.tix.TOP, padx=20, pady=2)
r.pack(side=Tix.TOP, padx=20, pady=2) r.pack(side=tkinter.tix.TOP, padx=20, pady=2)
c.pack(side=Tix.TOP, padx=20, pady=2) c.pack(side=tkinter.tix.TOP, padx=20, pady=2)
# Create the common buttons # Create the common buttons
createCommonButtons(common) createCommonButtons(common)
...@@ -79,23 +79,23 @@ def RunSample(w): ...@@ -79,23 +79,23 @@ def RunSample(w):
tab = nb.network tab = nb.network
f = Tix.Frame(tab) f = tkinter.tix.Frame(tab)
common = Tix.Frame(tab) common = tkinter.tix.Frame(tab)
f.pack(side=Tix.LEFT, padx=2, pady=2, fill=Tix.BOTH, expand=1) f.pack(side=tkinter.tix.LEFT, padx=2, pady=2, fill=tkinter.tix.BOTH, expand=1)
common.pack(side=Tix.RIGHT, padx=2, fill=Tix.Y) common.pack(side=tkinter.tix.RIGHT, padx=2, fill=tkinter.tix.Y)
a = Tix.Control(f, value=12, label='Access time: ') a = tkinter.tix.Control(f, value=12, label='Access time: ')
w = Tix.Control(f, value=400, label='Write Throughput: ') w = tkinter.tix.Control(f, value=400, label='Write Throughput: ')
r = Tix.Control(f, value=400, label='Read Throughput: ') r = tkinter.tix.Control(f, value=400, label='Read Throughput: ')
c = Tix.Control(f, value=1021, label='Capacity: ') c = tkinter.tix.Control(f, value=1021, label='Capacity: ')
u = Tix.Control(f, value=10, label='Users: ') u = tkinter.tix.Control(f, value=10, label='Users: ')
a.pack(side=Tix.TOP, padx=20, pady=2) a.pack(side=tkinter.tix.TOP, padx=20, pady=2)
w.pack(side=Tix.TOP, padx=20, pady=2) w.pack(side=tkinter.tix.TOP, padx=20, pady=2)
r.pack(side=Tix.TOP, padx=20, pady=2) r.pack(side=tkinter.tix.TOP, padx=20, pady=2)
c.pack(side=Tix.TOP, padx=20, pady=2) c.pack(side=tkinter.tix.TOP, padx=20, pady=2)
u.pack(side=Tix.TOP, padx=20, pady=2) u.pack(side=tkinter.tix.TOP, padx=20, pady=2)
createCommonButtons(common) createCommonButtons(common)
...@@ -104,16 +104,16 @@ def doDestroy(): ...@@ -104,16 +104,16 @@ def doDestroy():
root.destroy() root.destroy()
def createCommonButtons(master): def createCommonButtons(master):
ok = Tix.Button(master, name='ok', text='OK', width=6, ok = tkinter.tix.Button(master, name='ok', text='OK', width=6,
command=doDestroy) command=doDestroy)
cancel = Tix.Button(master, name='cancel', cancel = tkinter.tix.Button(master, name='cancel',
text='Cancel', width=6, text='Cancel', width=6,
command=doDestroy) command=doDestroy)
ok.pack(side=Tix.TOP, padx=2, pady=2) ok.pack(side=tkinter.tix.TOP, padx=2, pady=2)
cancel.pack(side=Tix.TOP, padx=2, pady=2) cancel.pack(side=tkinter.tix.TOP, padx=2, pady=2)
if __name__ == '__main__': if __name__ == '__main__':
root = Tix.Tk() root = tkinter.tix.Tk()
RunSample(root) RunSample(root)
root.mainloop() root.mainloop()
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# This file demonstrates the use of the tixOptionMenu widget -- you can # This file demonstrates the use of the tixOptionMenu widget -- you can
# use it for the user to choose from a fixed set of options # use it for the user to choose from a fixed set of options
# #
import Tix import tkinter.tix
options = {'text':'Plain Text', 'post':'PostScript', 'html':'HTML', options = {'text':'Plain Text', 'post':'PostScript', 'html':'HTML',
'tex':'LaTeX', 'rtf':'Rich Text Format'} 'tex':'LaTeX', 'rtf':'Rich Text Format'}
...@@ -21,16 +21,16 @@ options = {'text':'Plain Text', 'post':'PostScript', 'html':'HTML', ...@@ -21,16 +21,16 @@ options = {'text':'Plain Text', 'post':'PostScript', 'html':'HTML',
def RunSample(w): def RunSample(w):
global demo_opt_from, demo_opt_to global demo_opt_from, demo_opt_to
demo_opt_from = Tix.StringVar() demo_opt_from = tkinter.tix.StringVar()
demo_opt_to = Tix.StringVar() demo_opt_to = tkinter.tix.StringVar()
top = Tix.Frame(w, bd=1, relief=Tix.RAISED) top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED)
from_file = Tix.OptionMenu(top, label="From File Format : ", from_file = tkinter.tix.OptionMenu(top, label="From File Format : ",
variable=demo_opt_from, variable=demo_opt_from,
options = 'label.width 19 label.anchor e menubutton.width 15') options = 'label.width 19 label.anchor e menubutton.width 15')
to_file = Tix.OptionMenu(top, label="To File Format : ", to_file = tkinter.tix.OptionMenu(top, label="To File Format : ",
variable=demo_opt_to, variable=demo_opt_to,
options='label.width 19 label.anchor e menubutton.width 15') options='label.width 19 label.anchor e menubutton.width 15')
...@@ -47,22 +47,22 @@ def RunSample(w): ...@@ -47,22 +47,22 @@ def RunSample(w):
demo_opt_from.set('html') demo_opt_from.set('html')
demo_opt_to.set('post') demo_opt_to.set('post')
from_file.pack(side=Tix.TOP, anchor=Tix.W, pady=3, padx=6) from_file.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W, pady=3, padx=6)
to_file.pack(side=Tix.TOP, anchor=Tix.W, pady=3, padx=6) to_file.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W, pady=3, padx=6)
box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
box.add('ok', text='Ok', underline=0, width=6, box.add('ok', text='Ok', underline=0, width=6,
command=lambda w=w: ok_command(w)) command=lambda w=w: ok_command(w))
box.add('cancel', text='Cancel', underline=0, width=6, box.add('cancel', text='Cancel', underline=0, width=6,
command=lambda w=w: w.destroy()) command=lambda w=w: w.destroy())
box.pack(side=Tix.BOTTOM, fill=Tix.X) box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
def ok_command(w): def ok_command(w):
# tixDemo:Status "Convert file from %s to %s" % ( demo_opt_from.get(), demo_opt_to.get()) # tixDemo:Status "Convert file from %s to %s" % ( demo_opt_from.get(), demo_opt_to.get())
w.destroy() w.destroy()
if __name__ == '__main__': if __name__ == '__main__':
root = Tix.Tk() root = tkinter.tix.Tk()
RunSample(root) RunSample(root)
root.mainloop() root.mainloop()
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
# of artical names and the size of the text widget that shows the body # of artical names and the size of the text widget that shows the body
# of the article. # of the article.
import Tix import tkinter.tix
TCL_ALL_EVENTS = 0 TCL_ALL_EVENTS = 0
...@@ -32,30 +32,30 @@ class DemoPanedwin: ...@@ -32,30 +32,30 @@ class DemoPanedwin:
z = w.winfo_toplevel() z = w.winfo_toplevel()
z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd()) z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
group = Tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25') group = tkinter.tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25')
group.entry.insert(0,'comp.lang.python') group.entry.insert(0,'comp.lang.python')
pane = Tix.PanedWindow(w, orientation='vertical') pane = tkinter.tix.PanedWindow(w, orientation='vertical')
p1 = pane.add('list', min=70, size=100) p1 = pane.add('list', min=70, size=100)
p2 = pane.add('text', min=70) p2 = pane.add('text', min=70)
list = Tix.ScrolledListBox(p1) list = tkinter.tix.ScrolledListBox(p1)
list.listbox['width'] = 80 list.listbox['width'] = 80
list.listbox['height'] = 5 list.listbox['height'] = 5
text = Tix.ScrolledText(p2) text = tkinter.tix.ScrolledText(p2)
text.text['width'] = 80 text.text['width'] = 80
text.text['height'] = 20 text.text['height'] = 20
list.listbox.insert(Tix.END, " 12324 Re: Tkinter is good for your health") list.listbox.insert(tkinter.tix.END, " 12324 Re: Tkinter is good for your health")
list.listbox.insert(Tix.END, "+ 12325 Re: Tkinter is good for your health") list.listbox.insert(tkinter.tix.END, "+ 12325 Re: Tkinter is good for your health")
list.listbox.insert(Tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)") list.listbox.insert(tkinter.tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)")
list.listbox.insert(Tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)") list.listbox.insert(tkinter.tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)")
list.listbox.insert(Tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)") list.listbox.insert(tkinter.tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)")
list.listbox.insert(Tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)") list.listbox.insert(tkinter.tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)")
list.listbox.insert(Tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)") list.listbox.insert(tkinter.tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)")
text.text['bg'] = list.listbox['bg'] text.text['bg'] = list.listbox['bg']
text.text['wrap'] = 'none' text.text['wrap'] = 'none'
text.text.insert(Tix.END, """ text.text.insert(tkinter.tix.END, """
Mon, 19 Jun 1995 11:39:52 comp.lang.python Thread 34 of 220 Mon, 19 Jun 1995 11:39:52 comp.lang.python Thread 34 of 220
Lines 353 A new way to put text and bitmaps together iNo responses Lines 353 A new way to put text and bitmaps together iNo responses
ioi@blue.seas.upenn.edu Ioi K. Lam at University of Pennsylvania ioi@blue.seas.upenn.edu Ioi K. Lam at University of Pennsylvania
...@@ -70,18 +70,18 @@ class DemoPanedwin: ...@@ -70,18 +70,18 @@ class DemoPanedwin:
""") """)
text.text['state'] = 'disabled' text.text['state'] = 'disabled'
list.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6) list.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6)
text.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6) text.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6)
group.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH) group.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH)
pane.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH, expand=1) pane.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH, expand=1)
box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
box.add('ok', text='Ok', underline=0, width=6, box.add('ok', text='Ok', underline=0, width=6,
command=self.quitcmd) command=self.quitcmd)
box.add('cancel', text='Cancel', underline=0, width=6, box.add('cancel', text='Cancel', underline=0, width=6,
command=self.quitcmd) command=self.quitcmd)
box.pack(side=Tix.BOTTOM, fill=Tix.X) box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
def quitcmd (self): def quitcmd (self):
self.exit = 0 self.exit = 0
...@@ -94,5 +94,5 @@ class DemoPanedwin: ...@@ -94,5 +94,5 @@ class DemoPanedwin:
self.root.destroy() self.root.destroy()
if __name__ == '__main__': if __name__ == '__main__':
root = Tix.Tk() root = tkinter.tix.Tk()
RunSample(root) RunSample(root)
...@@ -12,18 +12,18 @@ ...@@ -12,18 +12,18 @@
# This file demonstrates the use of the tixPopupMenu widget. # This file demonstrates the use of the tixPopupMenu widget.
# #
import Tix import tkinter.tix
def RunSample(w): def RunSample(w):
# We create the frame and the button, then we'll bind the PopupMenu # We create the frame and the button, then we'll bind the PopupMenu
# to both widgets. The result is, when you press the right mouse # to both widgets. The result is, when you press the right mouse
# button over $w.top or $w.top.but, the PopupMenu will come up. # button over $w.top or $w.top.but, the PopupMenu will come up.
# #
top = Tix.Frame(w, relief=Tix.RAISED, bd=1) top = tkinter.tix.Frame(w, relief=tkinter.tix.RAISED, bd=1)
but = Tix.Button(top, text='Press the right mouse button over this button or its surrounding area') but = tkinter.tix.Button(top, text='Press the right mouse button over this button or its surrounding area')
but.pack(expand=1, fill=Tix.BOTH, padx=50, pady=50) but.pack(expand=1, fill=tkinter.tix.BOTH, padx=50, pady=50)
p = Tix.PopupMenu(top, title='Popup Test') p = tkinter.tix.PopupMenu(top, title='Popup Test')
p.bind_widget(top) p.bind_widget(top)
p.bind_widget(but) p.bind_widget(but)
...@@ -37,21 +37,21 @@ def RunSample(w): ...@@ -37,21 +37,21 @@ def RunSample(w):
p.menu.add_command(label='Find', underline=0) p.menu.add_command(label='Find', underline=0)
p.menu.add_command(label='System', underline=1) p.menu.add_command(label='System', underline=1)
p.menu.add_command(label='Help', underline=0) p.menu.add_command(label='Help', underline=0)
m1 = Tix.Menu(p.menu) m1 = tkinter.tix.Menu(p.menu)
m1.add_command(label='Hello') m1.add_command(label='Hello')
p.menu.add_cascade(label='More', menu=m1) p.menu.add_cascade(label='More', menu=m1)
but.pack(side=Tix.TOP, padx=40, pady=50) but.pack(side=tkinter.tix.TOP, padx=40, pady=50)
box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
box.add('ok', text='Ok', underline=0, width=6, box.add('ok', text='Ok', underline=0, width=6,
command=lambda w=w: w.destroy()) command=lambda w=w: w.destroy())
box.add('cancel', text='Cancel', underline=0, width=6, box.add('cancel', text='Cancel', underline=0, width=6,
command=lambda w=w: w.destroy()) command=lambda w=w: w.destroy())
box.pack(side=Tix.BOTTOM, fill=Tix.X) box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
if __name__ == '__main__': if __name__ == '__main__':
root = Tix.Tk() root = tkinter.tix.Tk()
RunSample(root) RunSample(root)
root.mainloop() root.mainloop()
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# This file demonstrates the use of the tixScrolledHList widget. # This file demonstrates the use of the tixScrolledHList widget.
# #
import Tix import tkinter.tix
TCL_ALL_EVENTS = 0 TCL_ALL_EVENTS = 0
...@@ -33,13 +33,13 @@ class DemoSHList: ...@@ -33,13 +33,13 @@ class DemoSHList:
# We create the frame and the ScrolledHList widget # We create the frame and the ScrolledHList widget
# at the top of the dialog box # at the top of the dialog box
# #
top = Tix.Frame( w, relief=Tix.RAISED, bd=1) top = tkinter.tix.Frame( w, relief=tkinter.tix.RAISED, bd=1)
# Put a simple hierachy into the HList (two levels). Use colors and # Put a simple hierachy into the HList (two levels). Use colors and
# separator widgets (frames) to make the list look fancy # separator widgets (frames) to make the list look fancy
# #
top.a = Tix.ScrolledHList(top) top.a = tkinter.tix.ScrolledHList(top)
top.a.pack( expand=1, fill=Tix.BOTH, padx=10, pady=10, side=Tix.TOP) top.a.pack( expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.TOP)
# This is our little relational database # This is our little relational database
# #
...@@ -68,13 +68,13 @@ class DemoSHList: ...@@ -68,13 +68,13 @@ class DemoSHList:
count=0 count=0
for boss,name in bosses : for boss,name in bosses :
if count : if count :
f=Tix.Frame(hlist, name='sep%d' % count, height=2, width=150, f=tkinter.tix.Frame(hlist, name='sep%d' % count, height=2, width=150,
bd=2, relief=Tix.SUNKEN ) bd=2, relief=tkinter.tix.SUNKEN )
hlist.add_child( itemtype=Tix.WINDOW, hlist.add_child( itemtype=tkinter.tix.WINDOW,
window=f, state=Tix.DISABLED ) window=f, state=tkinter.tix.DISABLED )
hlist.add(boss, itemtype=Tix.TEXT, text=name) hlist.add(boss, itemtype=tkinter.tix.TEXT, text=name)
count = count+1 count = count+1
...@@ -99,15 +99,15 @@ class DemoSHList: ...@@ -99,15 +99,15 @@ class DemoSHList:
# Use a ButtonBox to hold the buttons. # Use a ButtonBox to hold the buttons.
# #
box= Tix.ButtonBox(top, orientation=Tix.HORIZONTAL ) box= tkinter.tix.ButtonBox(top, orientation=tkinter.tix.HORIZONTAL )
box.add( 'ok', text='Ok', underline=0, width=6, box.add( 'ok', text='Ok', underline=0, width=6,
command = self.okcmd) command = self.okcmd)
box.add( 'cancel', text='Cancel', underline=0, width=6, box.add( 'cancel', text='Cancel', underline=0, width=6,
command = self.quitcmd) command = self.quitcmd)
box.pack( side=Tix.BOTTOM, fill=Tix.X) box.pack( side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
top.pack( side=Tix.TOP, fill=Tix.BOTH, expand=1 ) top.pack( side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1 )
def okcmd (self): def okcmd (self):
self.quitcmd() self.quitcmd()
...@@ -127,5 +127,5 @@ class DemoSHList: ...@@ -127,5 +127,5 @@ class DemoSHList:
# outside of the main demo program "tixwidgets.py". # outside of the main demo program "tixwidgets.py".
# #
if __name__== '__main__' : if __name__== '__main__' :
root=Tix.Tk() root=tkinter.tix.Tk()
RunSample(root) RunSample(root)
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# In a tixHList widget, you can have one ore more columns. # In a tixHList widget, you can have one ore more columns.
# #
import Tix import tkinter.tix
TCL_ALL_EVENTS = 0 TCL_ALL_EVENTS = 0
...@@ -36,13 +36,13 @@ class DemoSHList: ...@@ -36,13 +36,13 @@ class DemoSHList:
# We create the frame and the ScrolledHList widget # We create the frame and the ScrolledHList widget
# at the top of the dialog box # at the top of the dialog box
# #
top = Tix.Frame( w, relief=Tix.RAISED, bd=1) top = tkinter.tix.Frame( w, relief=tkinter.tix.RAISED, bd=1)
# Put a simple hierachy into the HList (two levels). Use colors and # Put a simple hierachy into the HList (two levels). Use colors and
# separator widgets (frames) to make the list look fancy # separator widgets (frames) to make the list look fancy
# #
top.a = Tix.ScrolledHList(top, options='hlist.columns 3 hlist.header 1' ) top.a = tkinter.tix.ScrolledHList(top, options='hlist.columns 3 hlist.header 1' )
top.a.pack( expand=1, fill=Tix.BOTH, padx=10, pady=10, side=Tix.TOP) top.a.pack( expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.TOP)
hlist=top.a.hlist hlist=top.a.hlist
...@@ -55,12 +55,12 @@ class DemoSHList: ...@@ -55,12 +55,12 @@ class DemoSHList:
# First some styles for the headers # First some styles for the headers
style={} style={}
style['header'] = Tix.DisplayStyle(Tix.TEXT, refwindow=hlist, style['header'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist,
anchor=Tix.CENTER, padx=8, pady=2, font = boldfont ) anchor=tkinter.tix.CENTER, padx=8, pady=2, font = boldfont )
hlist.header_create(0, itemtype=Tix.TEXT, text='Name', hlist.header_create(0, itemtype=tkinter.tix.TEXT, text='Name',
style=style['header']) style=style['header'])
hlist.header_create(1, itemtype=Tix.TEXT, text='Position', hlist.header_create(1, itemtype=tkinter.tix.TEXT, text='Position',
style=style['header']) style=style['header'])
# Notice that we use 3 columns in the hlist widget. This way when the user # Notice that we use 3 columns in the hlist widget. This way when the user
...@@ -90,13 +90,13 @@ class DemoSHList: ...@@ -90,13 +90,13 @@ class DemoSHList:
('chuck', 'jeff', 'Chuck McLean', 'Cleaner') ('chuck', 'jeff', 'Chuck McLean', 'Cleaner')
] ]
style['mgr_name'] = Tix.DisplayStyle(Tix.TEXT, refwindow=hlist) style['mgr_name'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist)
style['mgr_posn'] = Tix.DisplayStyle(Tix.TEXT, padx=8, refwindow=hlist) style['mgr_posn'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, padx=8, refwindow=hlist)
style['empl_name'] = Tix.DisplayStyle(Tix.TEXT, refwindow=hlist) style['empl_name'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist)
style['empl_posn'] = Tix.DisplayStyle(Tix.TEXT, padx=8, refwindow=hlist) style['empl_posn'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, padx=8, refwindow=hlist)
# Let configure the appearance of the HList subwidget # Let configure the appearance of the HList subwidget
# #
...@@ -105,9 +105,9 @@ class DemoSHList: ...@@ -105,9 +105,9 @@ class DemoSHList:
# Create the boss # Create the boss
# #
hlist.add ('.', itemtype=Tix.TEXT, text=boss[1], hlist.add ('.', itemtype=tkinter.tix.TEXT, text=boss[1],
style=style['mgr_name']) style=style['mgr_name'])
hlist.item_create('.', 1, itemtype=Tix.TEXT, text=boss[2], hlist.item_create('.', 1, itemtype=tkinter.tix.TEXT, text=boss[2],
style=style['mgr_posn']) style=style['mgr_posn'])
# Create the managers # Create the managers
...@@ -115,9 +115,9 @@ class DemoSHList: ...@@ -115,9 +115,9 @@ class DemoSHList:
for key,name,posn in managers : for key,name,posn in managers :
e= '.'+ key e= '.'+ key
hlist.add(e, itemtype=Tix.TEXT, text=name, hlist.add(e, itemtype=tkinter.tix.TEXT, text=name,
style=style['mgr_name']) style=style['mgr_name'])
hlist.item_create(e, 1, itemtype=Tix.TEXT, text=posn, hlist.item_create(e, 1, itemtype=tkinter.tix.TEXT, text=posn,
style=style['mgr_posn']) style=style['mgr_posn'])
...@@ -130,21 +130,21 @@ class DemoSHList: ...@@ -130,21 +130,21 @@ class DemoSHList:
# parent entryPath / child's name # parent entryPath / child's name
hlist.add(entrypath, text=name, style=style['empl_name']) hlist.add(entrypath, text=name, style=style['empl_name'])
hlist.item_create(entrypath, 1, itemtype=Tix.TEXT, hlist.item_create(entrypath, 1, itemtype=tkinter.tix.TEXT,
text = posn, style = style['empl_posn'] ) text = posn, style = style['empl_posn'] )
# Use a ButtonBox to hold the buttons. # Use a ButtonBox to hold the buttons.
# #
box= Tix.ButtonBox(top, orientation=Tix.HORIZONTAL ) box= tkinter.tix.ButtonBox(top, orientation=tkinter.tix.HORIZONTAL )
box.add( 'ok', text='Ok', underline=0, width=6, box.add( 'ok', text='Ok', underline=0, width=6,
command = self.okcmd ) command = self.okcmd )
box.add( 'cancel', text='Cancel', underline=0, width=6, box.add( 'cancel', text='Cancel', underline=0, width=6,
command = self.quitcmd ) command = self.quitcmd )
box.pack( side=Tix.BOTTOM, fill=Tix.X) box.pack( side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
top.pack( side=Tix.TOP, fill=Tix.BOTH, expand=1 ) top.pack( side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1 )
def okcmd (self): def okcmd (self):
self.quitcmd() self.quitcmd()
...@@ -164,5 +164,5 @@ class DemoSHList: ...@@ -164,5 +164,5 @@ class DemoSHList:
# outside of the main demo program "tixwidgets.py". # outside of the main demo program "tixwidgets.py".
# #
if __name__== '__main__' : if __name__== '__main__' :
root=Tix.Tk() root=tkinter.tix.Tk()
RunSample(root) RunSample(root)
...@@ -14,30 +14,30 @@ ...@@ -14,30 +14,30 @@
# dynamic hierachical data (the files in the Unix file system) # dynamic hierachical data (the files in the Unix file system)
# #
import Tix, os import tkinter.tix, os
def RunSample(w): def RunSample(w):
top = Tix.Frame(w, relief=Tix.RAISED, bd=1) top = tkinter.tix.Frame(w, relief=tkinter.tix.RAISED, bd=1)
tree = Tix.Tree(top, options='separator "/"') tree = tkinter.tix.Tree(top, options='separator "/"')
tree.pack(expand=1, fill=Tix.BOTH, padx=10, pady=10, side=Tix.LEFT) tree.pack(expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.LEFT)
tree['opencmd'] = lambda dir=None, w=tree: opendir(w, dir) tree['opencmd'] = lambda dir=None, w=tree: opendir(w, dir)
# The / directory is added in the "open" mode. The user can open it # The / directory is added in the "open" mode. The user can open it
# and then browse its subdirectories ... # and then browse its subdirectories ...
adddir(tree, "/") adddir(tree, "/")
box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
box.add('ok', text='Ok', underline=0, command=w.destroy, width=6) box.add('ok', text='Ok', underline=0, command=w.destroy, width=6)
box.add('cancel', text='Cancel', underline=0, command=w.destroy, width=6) box.add('cancel', text='Cancel', underline=0, command=w.destroy, width=6)
box.pack(side=Tix.BOTTOM, fill=Tix.X) box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
def adddir(tree, dir): def adddir(tree, dir):
if dir == '/': if dir == '/':
text = '/' text = '/'
else: else:
text = os.path.basename(dir) text = os.path.basename(dir)
tree.hlist.add(dir, itemtype=Tix.IMAGETEXT, text=text, tree.hlist.add(dir, itemtype=tkinter.tix.IMAGETEXT, text=text,
image=tree.tk.call('tix', 'getimage', 'folder')) image=tree.tk.call('tix', 'getimage', 'folder'))
try: try:
os.listdir(dir) os.listdir(dir)
...@@ -71,10 +71,10 @@ def opendir(tree, dir): ...@@ -71,10 +71,10 @@ def opendir(tree, dir):
if os.path.isdir(dir + '/' + file): if os.path.isdir(dir + '/' + file):
adddir(tree, dir + '/' + file) adddir(tree, dir + '/' + file)
else: else:
tree.hlist.add(dir + '/' + file, itemtype=Tix.IMAGETEXT, text=file, tree.hlist.add(dir + '/' + file, itemtype=tkinter.tix.IMAGETEXT, text=file,
image=tree.tk.call('tix', 'getimage', 'file')) image=tree.tk.call('tix', 'getimage', 'file'))
if __name__ == '__main__': if __name__ == '__main__':
root = Tix.Tk() root = tkinter.tix.Tk()
RunSample(root) RunSample(root)
root.mainloop() root.mainloop()
This diff is collapsed.
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# -- totally static, though different between PackDialog and WidgetDialog # -- totally static, though different between PackDialog and WidgetDialog
# (but even that could be unified) # (but even that could be unified)
from Tkinter import * from tkinter import *
class Option: class Option:
......
# Widget to display a man page # Widget to display a man page
import re import re
from Tkinter import * from tkinter import *
from Tkinter import _tkinter from tkinter import _tkinter
from ScrolledText import ScrolledText from tkinter.scrolledtext import ScrolledText
# XXX These fonts may have to be changed to match your system # XXX These fonts may have to be changed to match your system
BOLDFONT = '*-Courier-Bold-R-Normal-*-120-*' BOLDFONT = '*-Courier-Bold-R-Normal-*-120-*'
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
import string import string
from types import * from types import *
from Tkinter import * from tkinter import *
from ScrolledText import ScrolledText from tkinter.scrolledtext import ScrolledText
class MimeViewer: class MimeViewer:
def __init__(self, parent, title, msg): def __init__(self, parent, title, msg):
......
import os import os
import sys import sys
import string import string
from Tkinter import * from tkinter import *
from ScrolledText import ScrolledText from tkinter.scrolledtext import ScrolledText
from Dialog import Dialog from tkinter.dialog import Dialog
import signal import signal
BUFSIZE = 512 BUFSIZE = 512
......
# Brownian motion -- an example of a multi-threaded Tkinter program. # Brownian motion -- an example of a multi-threaded Tkinter program.
from Tkinter import * from tkinter import *
import random import random
import threading import threading
import time import time
......
# Brownian motion -- an example of a NON multi-threaded Tkinter program ;) # Brownian motion -- an example of a NON multi-threaded Tkinter program ;)
# By Michele Simoniato, inspired by brownian.py # By Michele Simoniato, inspired by brownian.py
from Tkinter import * from tkinter import *
import random import random
import sys import sys
......
#! /usr/bin/env python #! /usr/bin/env python
from Tkinter import * from tkinter import *
from Canvas import Oval, Group, CanvasText from Canvas import Oval, Group, CanvasText
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# optional bitmap, and any number of buttons. # optional bitmap, and any number of buttons.
# Cf. Ousterhout, Tcl and the Tk Toolkit, Figs. 27.2-3, pp. 269-270. # Cf. Ousterhout, Tcl and the Tk Toolkit, Figs. 27.2-3, pp. 269-270.
from Tkinter import * from tkinter import *
import sys import sys
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# /usr/include/X11/bitmaps for samples); it is displayed as the # /usr/include/X11/bitmaps for samples); it is displayed as the
# background of the animation. Default is no bitmap. # background of the animation. Default is no bitmap.
from Tkinter import * from tkinter import *
import random import random
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# background of the animation. Default is no bitmap. # background of the animation. Default is no bitmap.
# This uses Steen Lumholt's Tk interface # This uses Steen Lumholt's Tk interface
from Tkinter import * from tkinter import *
# Basic Towers-of-Hanoi algorithm: move n pieces from a to b, using c # Basic Towers-of-Hanoi algorithm: move n pieces from a to b, using c
......
# Display hello, world in a button; clicking it quits the program # Display hello, world in a button; clicking it quits the program
import sys import sys
from Tkinter import * from tkinter import *
def main(): def main():
root = Tk() root = Tk()
......
"""Draw on top of an image""" """Draw on top of an image"""
from Tkinter import * from tkinter import *
import sys import sys
def main(): def main():
......
from Tkinter import * from tkinter import *
import sys import sys
def main(): def main():
......
#! /usr/bin/env python #! /usr/bin/env python
# Tkinter interface to Linux `kill' command. # Tkinter interface to Linux `kill' command.
from Tkinter import * from tkinter import *
from string import splitfields from string import splitfields
from string import split from string import split
import subprocess import subprocess
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import sys import sys
import string import string
from Tkinter import * from tkinter import *
def listtree(master, app): def listtree(master, app):
list = Listbox(master, name='list') list = Listbox(master, name='list')
......
...@@ -9,7 +9,7 @@ import getopt ...@@ -9,7 +9,7 @@ import getopt
import string import string
import mhlib import mhlib
from Tkinter import * from tkinter import *
from dialog import dialog from dialog import dialog
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"""Play with the new Tk 8.0 toplevel menu option.""" """Play with the new Tk 8.0 toplevel menu option."""
from Tkinter import * from tkinter import *
class App: class App:
......
# option menu sample (Fredrik Lundh, September 1997) # option menu sample (Fredrik Lundh, September 1997)
from Tkinter import * from tkinter import *
root = Tk() root = Tk()
......
...@@ -20,7 +20,7 @@ options like other shapes or colors... ...@@ -20,7 +20,7 @@ options like other shapes or colors...
davem@magnet.com davem@magnet.com
""" """
from Tkinter import * from tkinter import *
"""paint.py: not exactly a paint program.. just a smooth line drawing demo.""" """paint.py: not exactly a paint program.. just a smooth line drawing demo."""
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# XXX This should be written in a more Python-like style!!! # XXX This should be written in a more Python-like style!!!
from Tkinter import * from tkinter import *
import sys import sys
# 1. Create basic application structure: menu bar on top of # 1. Create basic application structure: menu bar on top of
......
...@@ -25,7 +25,7 @@ know! ...@@ -25,7 +25,7 @@ know!
import math import math
import random import random
from Tkinter import * from tkinter import *
from Canvas import Rectangle, CanvasText, Group, Window from Canvas import Rectangle, CanvasText, Group, Window
......
...@@ -19,7 +19,7 @@ stand-alone application. ...@@ -19,7 +19,7 @@ stand-alone application.
""" """
from Tkinter import * from tkinter import *
from Canvas import Line, Rectangle from Canvas import Line, Rectangle
import random import random
......
...@@ -485,7 +485,7 @@ def colnum2name(n): ...@@ -485,7 +485,7 @@ def colnum2name(n):
s = chr(m+ord('A')) + s s = chr(m+ord('A')) + s
return s return s
import Tkinter as Tk import tkinter as Tk
class SheetGUI: class SheetGUI:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Tkinter interface to SYSV `ps' and `kill' commands. # Tkinter interface to SYSV `ps' and `kill' commands.
from Tkinter import * from tkinter import *
if TkVersion < 4.0: if TkVersion < 4.0:
raise ImportError("This version of svkill requires Tk 4.0 or later") raise ImportError("This version of svkill requires Tk 4.0 or later")
......
# Show how to do switchable panels. # Show how to do switchable panels.
from Tkinter import * from tkinter import *
class App: class App:
......
...@@ -6,7 +6,7 @@ import sys ...@@ -6,7 +6,7 @@ import sys
import os import os
import string import string
import re import re
from Tkinter import * from tkinter import *
from ManPage import ManPage from ManPage import ManPage
MANNDIRLIST = ['/depot/sundry/man/mann','/usr/local/man/mann'] MANNDIRLIST = ['/depot/sundry/man/mann','/usr/local/man/mann']
......
from Tkinter import * from tkinter import *
# note that there is no explicit call to start Tk. # note that there is no explicit call to start Tk.
# Tkinter is smart enough to start the system if it's not already going. # Tkinter is smart enough to start the system if it's not already going.
......
from Tkinter import * from tkinter import *
# This program shows how to use the "after" function to make animation. # This program shows how to use the "after" function to make animation.
......
from Tkinter import * from tkinter import *
# this is the same as simple-demo-1.py, but uses # this is the same as simple-demo-1.py, but uses
# subclassing. # subclassing.
......
from Tkinter import * from tkinter import *
import string import string
# This program shows how to use a simple type-in box # This program shows how to use a simple type-in box
......
from Tkinter import * from tkinter import *
# this program creates a canvas and puts a single polygon on the canvas # this program creates a canvas and puts a single polygon on the canvas
......
from Tkinter import * from tkinter import *
# this is the same as simple-demo-1.py, but uses # this is the same as simple-demo-1.py, but uses
# subclassing. # subclassing.
......
from Tkinter import * from tkinter import *
# this file demonstrates a more sophisticated movement -- # this file demonstrates a more sophisticated movement --
# move dots or create new ones if you click outside the dots # move dots or create new ones if you click outside the dots
......
from Tkinter import * from tkinter import *
# this file demonstrates the movement of a single canvas item under mouse control # this file demonstrates the movement of a single canvas item under mouse control
......
from Tkinter import * from tkinter import *
# allows moving dots with multiple selection. # allows moving dots with multiple selection.
......
from Tkinter import * from tkinter import *
class Test(Frame): class Test(Frame):
......
from Tkinter import * from tkinter import *
# this file demonstrates the creation of widgets as part of a canvas object # this file demonstrates the creation of widgets as part of a canvas object
......
from Tkinter import * from tkinter import *
# This example program creates a scroling canvas, and demonstrates # This example program creates a scroling canvas, and demonstrates
# how to tie scrollbars and canvses together. The mechanism # how to tie scrollbars and canvses together. The mechanism
......
from Tkinter import * from tkinter import *
from Dialog import Dialog from tkinter.dialog import Dialog
# this shows how to create a new window with a button in it # this shows how to create a new window with a button in it
# that can create new windows # that can create new windows
......
from Tkinter import * from tkinter import *
import string import string
# This program shows how to use a simple type-in box # This program shows how to use a simple type-in box
......
from Tkinter import * from tkinter import *
import string import string
# This program shows how to make a typein box shadow a program variable. # This program shows how to make a typein box shadow a program variable.
......
from Tkinter import * from tkinter import *
# This file shows how to trap the killing of a window # This file shows how to trap the killing of a window
# when the user uses window manager menus (typ. upper left hand corner # when the user uses window manager menus (typ. upper left hand corner
......
from Tkinter import * from tkinter import *
# some vocabulary to keep from getting confused. This terminology # some vocabulary to keep from getting confused. This terminology
# is something I cooked up for this file, but follows the man pages # is something I cooked up for this file, but follows the man pages
......
from Tkinter import * from tkinter import *
# some vocabulary to keep from getting confused. This terminology # some vocabulary to keep from getting confused. This terminology
# is something I cooked up for this file, but follows the man pages # is something I cooked up for this file, but follows the man pages
......
from Tkinter import * from tkinter import *
class Test(Frame): class Test(Frame):
......
from Tkinter import * from tkinter import *
class Test(Frame): class Test(Frame):
......
from Tkinter import * from tkinter import *
# This is a program that tests the placer geom manager in conjunction with # This is a program that tests the placer geom manager in conjunction with
# the packer. The background (green) is packed, while the widget inside is placed # the packer. The background (green) is packed, while the widget inside is placed
......
from Tkinter import * from tkinter import *
class Test(Frame): class Test(Frame):
......
from Tkinter import * from tkinter import *
# This is a program that tests the placer geom manager # This is a program that tests the placer geom manager
......
from Tkinter import * from tkinter import *
import string import string
......
from Tkinter import * from tkinter import *
# this file demonstrates the creation of widgets as part of a canvas object # this file demonstrates the creation of widgets as part of a canvas object
......
from Tkinter import * from tkinter import *
# This is a demo program that shows how to # This is a demo program that shows how to
# create radio buttons and how to get other widgets to # create radio buttons and how to get other widgets to
......
from Tkinter import * from tkinter import *
class Test(Frame): class Test(Frame):
def printit(self): def printit(self):
......
from Tkinter import * from tkinter import *
class Test(Frame): class Test(Frame):
def printit(self): def printit(self):
......
from Tkinter import * from tkinter import *
# shows how to make a slider, set and get its value under program control # shows how to make a slider, set and get its value under program control
......
from Tkinter import * from tkinter import *
# This is a program that makes a simple two button application # This is a program that makes a simple two button application
......
from Tkinter import * from tkinter import *
# The way to think about this is that each radio button menu # The way to think about this is that each radio button menu
# controls a different variable -- clicking on one of the # controls a different variable -- clicking on one of the
......
from Tkinter import * from tkinter import *
# this shows how to create a new window with a button in it # this shows how to create a new window with a button in it
# that can create new windows # that can create new windows
......
from Tkinter import * from tkinter import *
# this shows how to spawn off new windows at a button press # this shows how to spawn off new windows at a button press
......
from Tkinter import * from tkinter import *
import sys import sys
##sys.path.append("/users/mjc4y/projects/python/tkinter/utils") ##sys.path.append("/users/mjc4y/projects/python/tkinter/utils")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment