Tkinter Create/Destory Button

Jason Swails jason.swails at gmail.com
Mon Oct 22 15:36:51 EDT 2012


On Fri, Oct 19, 2012 at 4:11 PM, <bbbenrothschild at gmail.com> wrote:

> I am trying to create a button in Tkinter and then when it is pressed
> delete it/have it disappear. Does anyone know the simplest script to do
> that with. Thanks for your help.
>

Note that there is a _big_ difference between having a button 'disappear'
and having it destroyed or deleted.  If it 'disappears', it still exists
and can be re-activated whenever you want (as long as you keep an active
reference to it).  Once you destroy the widget, there is no recovering it.

My suggestion is to provide some code that you've tried, and allow people
to help explain why it did not work the way you thought it would.

And take a look at http://effbot.org/tkinterbook/tkinter-index.htm -- it
has proven to be a helpful reference to me.  The actual code to do what you
want is not complex (it took me ~20 lines), but learning how to do it is
quite helpful.

Good luck,
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20121022/d95bab60/attachment.html>


More information about the Python-list mailing list