]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/CalendarCtrl.py
Removed some test code
[wxWidgets.git] / wxPython / demo / CalendarCtrl.py
index f8e5ba78c1bf724f1bc21a8a9df15db235e70fe4..b91e8f8d3e3d41614b3791c0e2bfb56176a130bb 100644 (file)
@@ -27,8 +27,9 @@ class TestPanel(wx.Panel):
         self.OnChangeMonth()
 
     def OnButton(self, evt):
-        self.cal.Destroy()
-        self.cal = None
+        if self.cal is not None:
+            self.cal.Destroy()
+            self.cal = None
 
     def OnCalSelected(self, evt):
         self.log.write('OnCalSelected: %s\n' % evt.GetDate())