From: John L. <jla...@gm...> - 2012-06-12 03:35:23
|
On Mon, Jun 11, 2012 at 1:53 PM, Andre Arpin <ar...@ki...> wrote: > Andre Arpin <arpin@...> writes: > >> cal:Connect(wx.wxID_ANY, wx.wxEVT_CALENDAR_DAY_CHANGED, >> function(event) >> dt = event:GetDate() > > problem is that event:GetDate() is not cal:GetDate() > but a temporary wxDateTime() the code should probably be Yes, the function returned "const wxDateTime& GetDate() const" which is an optimization for when you want to simply call a wxDateTime function and not save the object itself. I've changed it so that it simply returns a new wxDateTime object so it will never go out of scope when the event is garbage collected. I've also added a wxDateTime copy constructor so that you can make copies of a wxDateTime using: dt1 = wx.wxDateTime(...) dt2 = wx.wxDateTime(dt1) This should fix any problems with the wxDateEvent. Regards, John |