[Tutor] frame destroy problem

Chris Hare chare at labr.net
Thu Nov 3 13:58:27 CET 2011


	
Dang it - sure is a typo!
Thanks!

Chris Hare
chare at labr.net
http://www.labr.net

On Nov 3, 2011, at 12:58 AM, Dipo Elegbede wrote:

> 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
> 
> _______________________________________________
> 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/233f2f5e/attachment.html>


More information about the Tutor mailing list