On Mon, Jun 11, 2012 at 1:53 PM, Andre Arpin <[email protected]> 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

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to