|
List Info
Thread: Trouble with wx.GridBagSizer
|
|
| Trouble with wx.GridBagSizer |

|
2007-10-18 16:45:33 |
|
Hey all, I';m using a gridbagsizer for a wx.Dialog, and i'm having some trouble. When I try to initiate the dialog, my program just freezes up and does nothing, not even sending an error back to the error log.
Here's the code for my dialog- --------------------------------------------------------------------------------- import wx
ID_FIND = 301 ID_FIND_B1 = 302 ID_FIND_B2 = 303 ID_FIND_TX = 304
ID_REPLACE = 351 ID_RPLC_B1 = 352 ID_RPLC_B2 = 353
class MainWin(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(850, 450)) #Menubar
menubar = wx.MenuBar() test = wx.Menu() find = wx.MenuItem(test, ID_FIND, 'Find', 'Find something.') test.AppendItem(find) replace = wx.MenuItem(test, ID_REPLACE, 'Replace', 'Replace something.')
test.AppendItem(replace) menubar.Append(test, '&Test') self.SetMenuBar(menubar) self.sb = self.CreateStatusBar() self.code =
wx.TextCtrl(self, ID_TEXTBOX, size=(200, 130), style=wx.TE_MULTILINE) self.code.SetFont(wx.Font(11, wx.FONTFAMILY_MODERN, wx.NORMAL, wx.NORMAL)) self.Bind(wx.EVT_MENU, self.OnFind, id=ID_FIND)
self.Bind(wx.EVT_MENU, self.OnReplace, id=ID_REPLACE) self.SetMinSize((300, 150)) self.Centre() self.Show(True)
def OnFind(self, event): class FindDialog(wx.Dialog):
def __init__(self, parent): wx.Dialog.__init__(self, parent, title=("Find")) sizer = wx.GridBagSizer(hgap=5, vgap=5) # stat_text =
wx.StaticText(self, 5000, "Enter text to find:") find_text = wx.TextCtrl(self) ok_find = wx.Button(self, ID_FIND_B1, 'Find') cancel_find = wx.Button
(self, ID_FIND_B2, 'Cancel') # &nb | |