Ticket #10658 (new defect)
Prevent wxStaticBox from being used as a parent
| Reported by: | dememax | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | GUI-all | Version: | 2.8.9 |
| Keywords: | crash wxpython | Cc: | cdleary@… |
| Blocked By: | Patch: | no | |
| Blocking: |
Description
This simple produces segfalut on Linux, on MS Windows XP it crashes too.
import wx class MyFrame(wx.Frame): def __init__( self, parent, ID, title, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE ): wx.Frame.__init__(self, parent, ID, title, pos, size, style) sizer = wx.BoxSizer(wx.VERTICAL) somebox = wx.StaticBox(self, -1, "Some"); wx.StaticText(somebox, -1, "Comment this problematic ctrl") sizer.Add(somebox, 0, wx.EXPAND) self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) def OnCloseWindow(self, event): self.Destroy() if __name__ == '__main__': app = wx.App() frame = MyFrame(None, -1, "aaa") app.SetTopWindow(frame) frame.Show() app.MainLoop()
Comment the line with StaticText and all works fine.
This line looks incorrect but it's not a reason to do a crash for running scripting environment (do anything - python exception, message box, but not a segfault).
Versions:
Gentoo Linux
Linux dememax-laptop 2.6.27-gentoo-r8 #2 SMP Fri Jan 23 13:42:35 MSK 2009 i686 Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz GenuineIntel GNU/Linux
dev-lang/python: 2.5.2-r7
x11-libs/gtk+: 2.14.7-r2
x11-libs/wxGTK: 2.8.9.1-r3
dev-python/wxpython: 2.8.9.1-r2
Change History
Note: See
TracTickets for help on using
tickets.
