Hi all,
(Sorry for my bad english, im french)
A wx.searchCtrl in a toolBar in a wx.dialog with wx.RESIZE_BORDER (and wx.DEFAUT_DIALOG_STYLE) crashes when i close the dialog.
But only if i have written something in the searchCtrl ! Amazing, no ?
You can reproduce problem with this code :
#!/usr/bin/env python
-- coding: iso-8859-15 --
import wx
class Dialog(wx.Dialog):
def init(self, parent):
wx.Dialog.init(self, parent, style=
wx.DEFAULT_DIALOG_STYLE
> wx.RESIZE_BORDER
| wx.MAXIMIZE_BOX
| wx.MINIMIZE_BOX
| wx.CAPTION
| wx.CLOSE_BOX
| wx.THICK_FRAME
)
panel = wx.Panel(self)
tb = wx.ToolBar(panel)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(tb, 0, wx.EXPAND)
panel.SetSizer(sizer)
search = wx.SearchCtrl(tb, -1, "")
tb.AddControl(search)
tb.Realize()
if name == “main”:
app = wx.App(0)
dialog_1 = Dialog(None)
app.SetTopWindow(dialog_1)
dialog_1.ShowModal()
app.MainLoop()
``
Do you know how i can avoid this bug ?
Thx for your help !