Oh man! Shoot me!!! Thanks so much.
Reuven
Robin Dunn wrote:
···
Reuven Koblick wrote:
Here is a CalendarCtrl code snippit. It's supposed to display MONDAY first and also respond to a double click. It does neither. Can someone help with something that must be obviously wrong? Thanks so much.
Your __init__ was named __init. Also you used the wrong object for the Bind, you had the Event type instead of the PyEventBinder instance.
import wx
from wx.calendar import CalendarCtrl
import wx.calendarclass MyCal(CalendarCtrl):
def __init__(self, parent, myId):
CalendarCtrl.__init__(self, parent, -1,
style=wx.calendar.CAL_MONDAY_FIRST
> wx.calendar.CAL_SEQUENTIAL_MONTH_SELECTION)self.Bind(wx.calendar.EVT_CALENDAR, self.OnDClick)
def OnDClick(self, evt):
print 'OnCalSelected: %s\n' % evt.GetDate()app = wx.PySimpleApp()
fr = wx.Frame(None, -1)
fr.SetBackgroundColour(wx.WHITE)
myCal = MyCal(fr, -1)
bx = wx.BoxSizer()
bx.Add(myCal, 1, wx.EXPAND|wx.ALL)
fr.SetSizer(bx)
fr.Fit()
fr.Show(True)
app.MainLoop()