Hello all,
I read through the archives and saw some questions about this event but I am still having some problems with it. I don’t know if this is a GNOME thing or I am doing something wrong. I am trying to run this small piece of code and when I close the application on Linux it prompts with “The window SimpleFrame is not responding” and asks me if I want to Force Quit or Cancel, however the window still responds if I click Cancel.
This does not happen on Windows and am wondering if anyone else has come accross a problem like this. If so is there a work-around so this doesn’t happen everytime I close the application.
By the way the flavor of Linux is RedHat.
import wx
class AppInit(wx.App):
def __init__(self, redirect=False, filename=None, useBestVisual=False, clearSigInit=True):
wx.App.__init__(self,redirect,filename,useBestVisual,clearSigInit)
def OnInit(self):
Frame = MyFrame()
Frame.Show(True)
self.SetTopWindow(Frame)
Frame.CentreOnScreen()
return True
class MyFrame(wx.Frame):
def __init__(self, parent=None, id=-1, title="SimpleFrame", pos=wx.DefaultPosition, size=(800,800),
style=wx.DEFAULT_FRAME_STYLE | wx.SUNKEN_BORDER | wx.CLIP_CHILDREN):
wx.Frame.__init__(self, parent, id, title, pos, size, style)
self.Bind(wx.EVT_CLOSE, self.OnAppClose)
def OnAppClose(self, evt):
msg = "Hold on there a minute"
dlg = wx.MessageDialog(None, msg, "Wait ...",
wx.YES_NO | wx.ICON_EXCLAMATION)
if dlg.ShowModal() == wx.ID_YES:
self.Destroy()
else:
return
dlg.Destroy()
App = AppInit(0)
App.MainLoop()
Thanks
Scott