[Tutor] frame destroy problem
Dipo Elegbede
delegbede at dudupay.com
Thu Nov 3 06:58:30 CET 2011
There is nothing called franeButton it should be frameButton. I guess its a
typo.
On 3 Nov 2011 05:52, "Chris Hare" <CHARE at labr.net> wrote:
>
> I have the following code:
>
> def listUsers(self):
> self.frameBottom = Frame(self.base, bd=0, bg=backColor)
> self.frameBottom.grid(row=1, column=0,sticky=N+E+S+W)
> self.text = Text(self.frameBottom)
> self.text.grid(row=1, column=6, columnspan=5, sticky=E)
> self.text.insert(END, security.listUsers())
> self.btnClose = Button(self.frameBottom, text="Close",
> command=self.closeFrameBottom,highlightbackground=backColor)
> self.btnClose.grid(row=2, column=4)
>
> def closeFrameBottom(self):
> self.franeBottom.destroy()
>
> When the listUsers method is called, everything is displayed correctly.
> However, when the btnClose is pressed, I get an error
>
> Exception in Tkinter callback
> Traceback (most recent call last):
> File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py",
> line 1410, in __call__
> return self.func(*args)
> File "z.py", line 454, in closeFrameBottom
> self.franeBottom.destroy()
> AttributeError: Display instance has no attribute 'franeBottom'
>
> What have I got wrong? the objective is to use the bottom part opt the
> window over and over again.
>
> Chris Hare
> chare at labr.net
> http://www.labr.net
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111103/2848cab7/attachment.html>
More information about the Tutor
mailing list