Created
September 2, 2009 19:20
-
-
Save batok/179917 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 the 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 = self.value | |
except: | |
value = "" | |
wx.MessageBox( value, "The value 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