title: Get selected date from python wx.lib.calendar
body: <p>How do you make button which open calendar then selects date and closes it?
  So far I managed just create calendars (I don't get why it always creates 2). But I couldn't figure out how to get selected date. I'm using pythonwx on Python 3.</p>
  
  <pre><code>class MyCalendar(wx.Frame):
  
      def __init__(self, *args, **kargs):
          wx.Frame.__init__(self, *args, **kargs)
          self.cal = CalendarCtrl(self, 10, wx.DateTime.Now())
          self.timer = wx.Timer(self)
  
  
  
  if __name__ == '__main__':  
      app = wx.App()
      frame = MyCalendar(None)
      frame.Show()
      app.MainLoop()
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>adding py3 version</p>
  
  <pre><code>from wx.adv import CalendarCtrl, GenericCalendarCtrl, CalendarDateAttr
  
  class MyCalendar(wx.Frame):
  
      def __init__(self, *args, **kargs):
          wx.Frame.__init__(self, *args, **kargs)
          self.cal = CalendarCtrl(self, 10, wx.DateTime.Now())
          self.cal.Bind(wx.adv.EVT_CALENDAR, self.OnDate)
  
  
  
      def OnDate(self,event):
          print (self.cal.GetDate())      
          wx.Window.Close(self)
  </code></pre>