wxpython 在关闭窗口时 执行自定的代码 可以弹窗 弹网页

class tradeWindow(wx.Frame):
    def __init__(self, parent, id):
        wx.Frame.__init__(self, parent, id, "Exchange", size = (500, 190))
        panel = wx.Panel(self)
        self.Bind(wx.EVT_CLOSE, self.OnClose)  # 判断窗口关闭
    def OnClose(self, event):
        tickThread.stopped = True   #替换在关闭窗口时  可以关闭其他线程 软件 cmd 弹窗 弹网页 在这里加
        self.Destroy()

 

posted @ 2020-10-28 16:25  凹凸曼大人  阅读(667)  评论(0)    收藏  举报