So just pressing the OK or Cancel button doesn't actually destroy a
dialog box? But does destroying it prevent the return value of which
button you pressed to be used? Or is that a separate issue? If I need
the return value, should I store the ShowModal() value in a variable
when the dialog closes?
···
---------- Forwarded message ----------
From: Robin Dunn <robin@alldunn.com>
To: wxPython-users@lists.wxwidgets.org
Date: Tue, 13 Jun 2006 19:06:26 -0700
Subject: Re: [wxPython-users] Re: bringing up a dialog box with a button
John Salerno wrote:
Sorry for a double reply. Just one more thing, after testing it
myself: is calling dialog.Destroy() necessary? It doesn't cause
problems if omitted, but perhaps there's advanced stuff going on under
the hood that I don't know about and I should explicitly destroy all
windows.
Just dialogs. They don't destroy themselves when they close like frames
do because you usually need to access the controls on the dialog after
it has closed in order to get values from them or etc. All windows with
a parent will be destroyed by their parents when they are destroyed, so
unless you are dynamically creating or removing controls you usually
don't need to call Destroy on any other windows.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!