<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffffff">
Here is the code:<br>
<br>
#!/usr/bin/python<br>
<br>
from Tkinter import *<br>
from tkMessageBox import *<br>
<br>
def iClicked():<br>
&nbsp;&nbsp;&nbsp; radioValue = relStatus.get()<br>
&nbsp;&nbsp;&nbsp; tkMessageBox.showinfo("You clicked", radioValue)<br>
&nbsp;&nbsp;&nbsp; return<br>
<br>
def chLabel():<br>
&nbsp;&nbsp;&nbsp; name = "Thank you for clicking me. " + your_name.get()<br>
&nbsp;&nbsp;&nbsp; labelText.set(name)<br>
&nbsp;&nbsp;&nbsp; your_name.delete(0, END)<br>
&nbsp;&nbsp;&nbsp; your_name.insert(0, "My name is Simon.")<br>
&nbsp;&nbsp;&nbsp; return<br>
<br>
myapp = Tk()<br>
myapp.title("This is the gui title")<br>
myapp.geometry("500x500+600+600")<br>
<br>
labelText = StringVar()<br>
labelText.set("Click button")<br>
label0 = Label(myapp, textvariable=labelText, height=4)<br>
label0.pack()<br>
<br>
chkbx = IntVar()<br>
chkbx0 = Checkbutton(myapp, variable=chkbx, text="Hungry?")<br>
chkbx0.pack()<br>
<br>
a_name = StringVar()<br>
your_name = Entry(myapp, textvariable=a_name)<br>
your_name.pack()<br>
<br>
# Once this section is commented out the window opens but without the
radio buttons.<br>
# I have attempted many variations of the two lines.<br>
relStatus = StringVar()<br>
relStatus.set(None)<br>
#radio0 = Radiobutton(myapp, text="had breakfast", value="had
breakfast", variable=relStatus, commmand=iClicked).pack(anchor=W)<br>
#radio0 = Radiobutton(myapp, text="did not eat breakfast", value="did
not eat breakfast", variable=relStatus,
commmand=iClicked).pack(anchor=W)<br>
#radio1 = Radiobutton(myapp, master=None, text="had breakfast",
value="had breakfast", variable=relStatus, commmand=iClicked).pack()<br>
#radio1 = Radiobutton(myapp, master=None, text="did not eat breakfast",
value="did not eat breakfast", variable=relStatus,
commmand=iClicked).pack()<br>
#radio1 = Radiobutton(myapp, text="had breakfast", value="had
breakfast", variable=relStatus, commmand=iClicked).pack()<br>
#radio1 = Radiobutton(myapp, text="did not eat breakfast", value="did
not eat breakfast", variable=relStatus, commmand=iClicked).pack()<br>
#radio0 = Radiobutton(master, text="had breakfast", value="had
breakfast", variable=myapp, commmand=iClicked).pack()<br>
#radio0 = Radiobutton(master, text="did not eat breakfast", value="did
not eat breakfast", variable=myapp, commmand=iClicked).pack()<br>
radio1 = Radiobutton(master=myapp, text="had breakfast", value="had
breakfast", variable=relStatus, commmand=iClicked).pack()<br>
radio1 = Radiobutton(master=myapp, text="did not eat breakfast",
value="did not eat breakfast", variable=relStatus,
commmand=iClicked).pack()<br>
# Something is wrong with the two lines above?<br>
<br>
button0 = Button(myapp, text="Click me", width=20, command=chLabel)<br>
button0.pack(side='bottom', padx=15, pady=15)<br>
<br>
myapp.mainloop()<br>
<br>
Here is the error:<br>
<br>
$ python tktest.py<br>
<br>
<font color="#cc0000"><b>Traceback (most recent call last):<br>
&nbsp; File "tkwindow.py", line 54, in &lt;module&gt;<br>
&nbsp;&nbsp;&nbsp; radio1 = Radiobutton(master=myapp, text="had breakfast", value="had
breakfast", variable=relStatus, commmand=iClicked).pack()<br>
&nbsp; File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 2732, in __init__<br>
&nbsp;&nbsp;&nbsp; Widget.__init__(self, master, 'radiobutton', cnf, kw)<br>
&nbsp; File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1935, in __init__<br>
&nbsp;&nbsp;&nbsp; (widgetName, self._w) + extra + self._options(cnf))<br>
_tkinter.TclError: unknown option "-commmand"</b></font><br>
<br>
<br>
</body>
</html>