forked from wxWidgets/wxPython-Classic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_destroyEvent.py
More file actions
32 lines (22 loc) · 761 Bytes
/
Copy pathtest_destroyEvent.py
File metadata and controls
32 lines (22 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import wx
ID = 10001
class TestFrame(wx.Frame):
def __init__(self, *args, **kw):
wx.Frame.__init__(self, *args, **kw)
p = wx.Panel(self)
b = wx.Button(p, -1, "Test it...", (15,15))
self.Bind(wx.EVT_BUTTON, self.onTestIt, b)
self.Bind(wx.EVT_WINDOW_DESTROY, self.onDestroy, id=ID)
def onTestIt(self, evt):
print "Testing destroy event..."
p = wx.Panel(self, ID)
wx.CallLater(100, p.Destroy)
def onDestroy(self, evt):
print 'Got destroy event:'
print ' Id:', evt.GetId()
print ' Obj:', evt.GetEventObject()
print ' Wnd:', evt.GetWindow()
app = wx.App(False)
frm = TestFrame(None, title="window destroy")
frm.Show()
app.MainLoop()