[wxPython-users] StdDialogButtonSizer - Crash for anyone else?
Werner F. Bruhin
werner.bruhin at free.fr
Wed Feb 28 08:58:51 PST 2007
Hi Kevin,
Kevin Watters wrote:
> 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)
d.SetSizerAndFit(s2)
d.ShowModal()
d.Destroy()
app.MainLoop()
Werner
More information about the wxpython-users
mailing list