I'm building a frame with some panels in it, and getting some weird
issues. There's too much code to post, but I wonder if anyone can
suggest where to start looking for this problem :
If I create multiple panels in a frame, some of the input widgets
don't respond to mouse clicks, although this behaviour is inconsistant
(at least, as far as I can tell).
Is there a simple guide to putting multiple panels in a frame (in this
case, AUI).
The frame code is here, is there some magic I need to use to get each
panel to see input or is this too vague?
class stSessionChooserFrame(wx.Frame):
def __init__(self, *args, **kwds):
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.mgr = wx.aui.AuiManager()
self.mgr.SetManagedWindow(self)
leftpanel = wx.Panel(self, -1, size = (200, 150))
rightpanel = wx.Panel(self, -1, size = (200, 150))
bottompanel = wx.Panel(self, -1, size = (200, 150))
SessionChooserPanel = stSCP.stSessionChooserPanel(self)
SessionCreatorPanel = stSCRP.stTrainingSession(self)
SessionCreatorPanel.new()
effortPanel = stEP.stEffortPanel(self)
session = stDC.TrainingSessions.FromId(thisSessionId)
rider = stDC.Riders.FromId(defaultRiderId)
effortPanel.new(session, rider, live)
self.mgr.AddPane(effortPanel, wx.aui.AuiPaneInfo().Bottom())
self.mgr.AddPane(SessionChooserPanel,
wx.aui.AuiPaneInfo().Left().Layer(1))
self.mgr.AddPane(SessionCreatorPanel,
wx.aui.AuiPaneInfo().Center().Layer(2))
self.mgr.Update()
# setting up the menus
fileMenu = wx.Menu()
helpMenu = wx.Menu()
# wx.ID_ABOUT and wx.ID_EXIT are standard ID's provided by
wxWidgets
menuAbout = fileMenu.Append(wx.ID_ABOUT,
"&About",defs.version)
fileMenu.AppendSeparator()
menuExit = fileMenu.Append(wx.ID_EXIT,"&Exit", "exterminate")
# create the menubar
menuBar = wx.MenuBar()
menuBar.Append(fileMenu, "&File")
menuBar.Append(helpMenu, "&Help")
self.SetMenuBar(menuBar)
#menuBar.Show()
self.statusbar = self.CreateStatusBar(2, wx.ST_SIZEGRIP)
self.statusbar.SetStatusWidths([-2, -1])
# statusbar fields
statusbar_fields = [(defs.about),
(defs.FullVersion)]
for i in range(len(statusbar_fields)):
self.statusbar.SetStatusText(statusbar_fields[i], i)
class MyApp(wx.App):
def OnInit(self):
wx.InitAllImageHandlers()
# pos=(0, 0), size=wx.DisplaySize()
sessionChooserFrame = stSessionChooserFrame(None, -1, "",
size=(900,600))
#effort = stEffortFrame(None, -1, "", pos=(0, 0),
size=wx.DisplaySize())
self.SetTopWindow(sessionChooserFrame)
sessionChooserFrame.Show()
return 1
# end of class MyApp
if __name__ == "__main__":
import gettext
gettext.install("EffortAdd") # replace with the appropriate
catalog name
EffortAdd = MyApp(0)
EffortAdd.MainLoop()