Does the following code crash for anyone else? It works on my
Vista machine but fails on my Macbook. Want to confirm before
I file a bug report.
import wx
if __name__ == '__main__':
app = wx.PySimpleApp()
f = wx.Frame(None)
s = f.Sizer = wx.StdDialogButtonSizer()
s.AddButton(wx.Button(f, wx.ID_SAVE, '&Save'))
s.AddButton(wx.Button(f, wx.ID_CANCEL, '&Cancel'))
s.Realize()
f.Show()
app.MainLoop()
Works great for me, no crash, just a window with "Cancel" in it.
What OS/version of wxPython are you using?
~ $ python
13:18
Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Does the following code crash for anyone else? It works on my
Vista machine but fails on my Macbook. Want to confirm before
I file a bug report.
import wx
if __name__ == '__main__':
app = wx.PySimpleApp()
f = wx.Frame(None)
s = f.Sizer = wx.StdDialogButtonSizer()
s.AddButton(wx.Button(f, wx.ID_SAVE, '&Save'))
s.AddButton(wx.Button(f, wx.ID_CANCEL, '&Cancel'))
s.Realize()
f.Show()
app.MainLoop()
Does not crash (Win XP, wxPython 2.6.3.3) but only shows one button. If I add a panel or change it to use a dialog then both buttons are shown, dialog example follows.
import wx
if __name__ == '__main__':
app = wx.PySimpleApp()
d = wx.Dialog(None)
t = wx.TextCtrl(d)
s = wx.StdDialogButtonSizer()
s.AddButton(wx.Button(d, wx.ID_SAVE, '&Save'))
s.AddButton(wx.Button(d, wx.ID_CANCEL, '&Cancel'))
s.Realize()
s2 = wx.BoxSizer(orient=wx.VERTICAL)
s2.AddWindow(t)
s2.AddWindow(s)