<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<font face="Franklin Gothic Medium">Im trying to code a simple GUI but I'm having a bit of a problem. Heres my code:</font><BR><font face="Franklin Gothic Medium"></font> <BR><font face="Franklin Gothic Medium">from tkinter import *</font><BR><font face="Franklin Gothic Medium">class Application(Frame):<br> def __init__(self,master=None):<br> Frame.__init__(self,master)<br> self.grid(sticky=N+S+E+W)<br> self.createWidgets()</font><BR><font face="Franklin Gothic Medium"> def createWidgets(self):<br> top=self.winfo_toplevel()<br> top.rowconfigure(0,weight=1)<br> top.columnconfigure(0,weight=1)<br> self.rowconfigure(0,weight=1)<br> self.columnconfigure(0,weight=1)<br> self.Nothing = Button(self,text='Nothing',activebackground='red',cursor='gumby',command=self.configure())<br> self.Nothing.grid(row=0,column=0,sticky=N+S+E+W)</font><BR><font face="Franklin Gothic Medium"> def configure(self):<br> self.Nothing.configure(text='Hello!')</font><BR><font face="Franklin Gothic Medium">app = Application()<br>app.master.title("The Nothing Button")<br>app.mainloop()</font><BR><font face="Franklin Gothic Medium"></font> <BR><font face="Franklin Gothic Medium">when I run the batch file, i get this error:<BR><br id="ecxFontBreak">Traceback (most recent call last):<br> File "C:\Python32\gui2.py", line 21, in <module><br> app = Application()<br> File "C:\Python32\gui2.py", line 7, in __init__<br> self.createWidgets()<br> File "C:\Python32\gui2.py", line 15, in createWidgets<br> self.Nothing = Button(self,text='Nothing',activebackground='red',cursor='gumby',command=self.configure())<br> File "C:\Python32\gui2.py", line 19, in configure<br> self.Nothing.configure(text='Hello!')<br>AttributeError: 'Application' object has no attribute 'Nothing'<BR> <BR>What I get from that is that its claiming that my Application class doesnt have an attribute called 'Nothing' but I clearly defined it in the 'createWidgets()' method. Can anyone explain to me exactly what the problem is. Thanks.</font><br><br><font face="Franklin Gothic Medium">Myles Broomes</font><br><BR>                                            </div></body>
</html>