I have a test program testwx.py to run wx.AboutBox running on CentOS 6.2, it is running fine, but click the close button, it closed the message box, but program testwx.py hang up until I manually kill it., what could be missing here?
I have a test program testwx.py to run wx.AboutBox running on CentOS 6.2, it is running fine, but click the close button, it closed the message box, but program testwx.py hang up until I manually kill it., what could be missing here?
I think you need to explicitly destroy them when you are done.
If you add “info.MessageBox.destroy” above your line “ex.MainLoop()”, then I think it will behave the way you expect.
Hmm, that does not work, it exited immediately. It seems close the window does not close the wx.AboutBox, the class was not destroyed, even I put a destruct which was not called.
I have a test program testwx.py to run wx.AboutBox running on CentOS 6.2, it is running fine, but click the close button, it closed the message box, but program testwx.py hang up until I manually kill it., what could be missing here?
Basically you haven’t told the AboutBox to close the program.
You need to have an event, e.g. closing the message box, which
triggers a exit on the App.MainLoop and after that has finished,
i.e. at the end of Test you need to destroy the App. Gadget/Steve
···
On 08/11/13 05:36, nobody h wrote:
On Friday, November 8, 2013 1:21:31 PM UTC+11, wrote:
–
You received this message because you are subscribed to the Google
Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it,
I have a test program testwx.py to run wx.AboutBox
running on CentOS 6.2, it is running fine, but click the
close button, it closed the message box, but program
testwx.py hang up until I manually kill it., what could
be missing here?
import wx
class InfoBox(wx.Frame):
def __init__(self, *args, **kwargs):
super(InfoBox, self).__init__(*args, **kwargs)
def MessageBox(self, message):
info = wx.AboutDialogInfo()
info.SetName("Test")
wx.AboutBox(info)
def Test():
ex = wx.App()
info = InfoBox(None)
info.MessageBox("hello test")
ex.MainLoop()
Test()
Thank you.
--
You received this message because you are subscribed
You normally would call the AboutBox from a menu and in there its
handler you should ensure that the dialog gets distroyed
(dialog.Destroy or using ‘with’).
In your sample you could just do this:
info.MessageBox(“hello test”)
info.Close()
Werner
···
Hi,
On 08/11/2013 06:36, nobody h wrote:
On Friday, November 8, 2013 1:21:31 PM UTC+11, wrote:
I have a test program testwx.py to run wx.AboutBox running on CentOS 6.2, it is running fine, but click the close button, it closed the message box, but program testwx.py hang up until I manually kill it., what could be missing here?