projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
corrected code to not suppose that Write() always writes all the data it was given
[wxWidgets.git]
/
wxPython
/
demo
/
CalendarCtrl.py
diff --git
a/wxPython/demo/CalendarCtrl.py
b/wxPython/demo/CalendarCtrl.py
index f8e5ba78c1bf724f1bc21a8a9df15db235e70fe4..798b155cc18a9eefd2a2d790a36ba6d3884abade 100644
(file)
--- a/
wxPython/demo/CalendarCtrl.py
+++ b/
wxPython/demo/CalendarCtrl.py
@@
-17,7
+17,7
@@
class TestPanel(wx.Panel):
self.Bind(wx.calendar.EVT_CALENDAR, self.OnCalSelected, id=cal.GetId())
self.Bind(wx.calendar.EVT_CALENDAR, self.OnCalSelected, id=cal.GetId())
- b = wx.Button(self, -1, "Destroy the Calendar", pos = (2
50
, 50))
+ b = wx.Button(self, -1, "Destroy the Calendar", pos = (2
75
, 50))
self.Bind(wx.EVT_BUTTON, self.OnButton, id= b.GetId())
self.cal = cal
self.Bind(wx.EVT_BUTTON, self.OnButton, id= b.GetId())
self.cal = cal
@@
-27,8
+27,9
@@
class TestPanel(wx.Panel):
self.OnChangeMonth()
def OnButton(self, evt):
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())
def OnCalSelected(self, evt):
self.log.write('OnCalSelected: %s\n' % evt.GetDate())
@@
-63,5
+64,5
@@
so I think both will stay in wxPython.
if __name__ == '__main__':
import sys,os
import run
if __name__ == '__main__':
import sys,os
import run
- run.main(['', os.path.basename(sys.argv[0])])
+ run.main(['', os.path.basename(sys.argv[0])]
+ sys.argv[1:]
)