diff options
author | Tim Peters <tim.peters@gmail.com> | 2004-07-18 06:16:08 +0000 |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2004-07-18 06:16:08 +0000 |
commit | 182b5aca27d376b08a2904bed42b751496f932f3 (patch) | |
tree | df13115820dbc879c0fe2eae488c9f8c0215a7da /Demo/tkinter/matt/radiobutton-simple.py | |
parent | e6ddc8b20b493fef2e7cffb2e1351fe1d238857e (diff) | |
download | cpython-git-182b5aca27d376b08a2904bed42b751496f932f3.tar.gz |
Whitespace normalization, via reindent.py.
Diffstat (limited to 'Demo/tkinter/matt/radiobutton-simple.py')
-rw-r--r-- | Demo/tkinter/matt/radiobutton-simple.py | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/Demo/tkinter/matt/radiobutton-simple.py b/Demo/tkinter/matt/radiobutton-simple.py index 65dfe52ba1..e9d6afee1c 100644 --- a/Demo/tkinter/matt/radiobutton-simple.py +++ b/Demo/tkinter/matt/radiobutton-simple.py @@ -1,10 +1,10 @@ from Tkinter import * -# This is a demo program that shows how to -# create radio buttons and how to get other widgets to -# share the information in a radio button. -# -# There are other ways of doing this too, but +# This is a demo program that shows how to +# create radio buttons and how to get other widgets to +# share the information in a radio button. +# +# There are other ways of doing this too, but # the "variable" option of radiobuttons seems to be the easiest. # # note how each button has a value it sets the variable to as it gets hit. @@ -12,50 +12,50 @@ from Tkinter import * class Test(Frame): def printit(self): - print "hi" + print "hi" def createWidgets(self): - self.flavor = StringVar() - self.flavor.set("chocolate") - - self.radioframe = Frame(self) - self.radioframe.pack() - - # 'text' is the label - # 'variable' is the name of the variable that all these radio buttons share - # 'value' is the value this variable takes on when the radio button is selected - # 'anchor' makes the text appear left justified (default is centered. ick) - self.radioframe.choc = Radiobutton( - self.radioframe, text="Chocolate Flavor", - variable=self.flavor, value="chocolate", - anchor=W) - self.radioframe.choc.pack(fill=X) - - self.radioframe.straw = Radiobutton( - self.radioframe, text="Strawberry Flavor", - variable=self.flavor, value="strawberry", - anchor=W) - self.radioframe.straw.pack(fill=X) - - self.radioframe.lemon = Radiobutton( - self.radioframe, text="Lemon Flavor", - variable=self.flavor, value="lemon", - anchor=W) - self.radioframe.lemon.pack(fill=X) - - # this is a text entry that lets you type in the name of a flavor too. - self.entry = Entry(self, textvariable=self.flavor) - self.entry.pack(fill=X) - self.QUIT = Button(self, text='QUIT', foreground='red', - command=self.quit) - self.QUIT.pack(side=BOTTOM, fill=BOTH) + self.flavor = StringVar() + self.flavor.set("chocolate") + + self.radioframe = Frame(self) + self.radioframe.pack() + + # 'text' is the label + # 'variable' is the name of the variable that all these radio buttons share + # 'value' is the value this variable takes on when the radio button is selected + # 'anchor' makes the text appear left justified (default is centered. ick) + self.radioframe.choc = Radiobutton( + self.radioframe, text="Chocolate Flavor", + variable=self.flavor, value="chocolate", + anchor=W) + self.radioframe.choc.pack(fill=X) + + self.radioframe.straw = Radiobutton( + self.radioframe, text="Strawberry Flavor", + variable=self.flavor, value="strawberry", + anchor=W) + self.radioframe.straw.pack(fill=X) + + self.radioframe.lemon = Radiobutton( + self.radioframe, text="Lemon Flavor", + variable=self.flavor, value="lemon", + anchor=W) + self.radioframe.lemon.pack(fill=X) + + # this is a text entry that lets you type in the name of a flavor too. + self.entry = Entry(self, textvariable=self.flavor) + self.entry.pack(fill=X) + self.QUIT = Button(self, text='QUIT', foreground='red', + command=self.quit) + self.QUIT.pack(side=BOTTOM, fill=BOTH) def __init__(self, master=None): - Frame.__init__(self, master) - Pack.config(self) - self.createWidgets() + Frame.__init__(self, master) + Pack.config(self) + self.createWidgets() test = Test() |