Skip to content

Instantly share code, notes, and snippets.

@batok
Created September 3, 2009 01:04
Show Gist options
  • Save batok/180062 to your computer and use it in GitHub Desktop.
Save batok/180062 to your computer and use it in GitHub Desktop.
import wx
from datetime import datetime
from wx.lib.calendar import CalenDlg
#this is a simple python script to show how wing ide mac os x version renders and interact bad with
#wx.lib.calendar.CalenDlg
# If one runs this from wing for mac, the dialog shows incomplete. When run outside wing de dialog shows and behaves ok.
#
class Frame( wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,-1, "Testing Calendar issue", size = ( 400,200))
self.panel = wx.Panel(self, -1)
btn = wx.Button( self.panel, -1, "Set Date")
self.Bind(wx.EVT_CLOSE, self.OnClose)
self.Bind(wx.EVT_BUTTON, self.OnButton, btn)
def OnButton(self,event):
cal = CalenDlg( self)
cal.Centre()
if cal.ShowModal() == wx.ID_OK:
self.value = cal.result
cal.Destroy()
return
def OnClose(self, event):
try:
value = "%s %s, %s" % (self.value[2],self.value[1], self.value[3])
except:
value = ""
wx.MessageBox( value, "Selected date is" )
self.Destroy()
if __name__ == "__main__":
app = wx.PySimpleApp()
f = Frame()
f.Center()
f.Show()
app.MainLoop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment