[Tutor] Tkinter problems

Mr. Derek L. Hoffmeister dmanxiii@yahoo.com
Sat, 6 Apr 2002 16:34:44 -0800 (PST)


--0-145114988-1018139684=:67163
Content-Type: text/plain; charset=us-ascii


Sorry People,

I guess I should have been more specific.  Anyways, here's the code I am trying to run.  

from Tkinter import *

class App:

    def _init_(self, master):

        frame = Frame(master)
        frame.pack()

        self.hi_there = Button(frame, text="Hello", command=self.say_hi)
        self.hi_there.pack(side=LEFT)

    def say_hi(self):
        print "Hi, Derek"

root = Tk()

app = App

root.mainloop()

The example I looked at had app=App(root), but when I run this I get: type error: this constructor takes no agruments.  So I took the arguments out...

Thanks People,

Derek Hoffmeister




---------------------------------
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
--0-145114988-1018139684=:67163
Content-Type: text/html; charset=us-ascii

<P>Sorry People,</P>
<P>I guess I should have been more specific.&nbsp; Anyways, here's the code I am trying to run.&nbsp; </P>
<P>from Tkinter import *</P>
<P>class App:</P>
<P>&nbsp;&nbsp;&nbsp; def _init_(self, master):</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; frame = Frame(master)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; frame.pack()</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.hi_there = Button(frame, text="Hello", command=self.say_hi)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.hi_there.pack(side=LEFT)</P>
<P>&nbsp;&nbsp;&nbsp; def say_hi(self):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print "Hi, Derek"</P>
<P>root = Tk()</P>
<P>app = App</P>
<P>root.mainloop()</P>
<P>The example I looked at had app=App(root), but when I run this I get: type error: this constructor takes no agruments.&nbsp; So I took the arguments out...</P>
<P>Thanks People,</P>
<P>Derek Hoffmeister<BR></P><p><br><hr size=1><b>Do You Yahoo!?</b><br>
<a href="$rd_url/welcome/?http://taxes.yahoo.com/">Yahoo! Tax Center</a> - online filing with TurboTax
--0-145114988-1018139684=:67163--