Ohh snap!
Here is an example that make me a liar...This simple
program blows away my hypothesis of a "simple" error.
I can easily move from panel to panel via mouse clicks.
I don't know why the real app is having problems I guess
I will have to try some serious debugging... Still the
app *does* work on Linux and WinXP...
Unfortunately it is rather involved, the top pane
is a sql input area, the second pane is used to report
status of each action and the bottom pane shows the
result of successful queries.
import wx
from wx.lib.splitter import MultiSplitterWindow
class SQLPane(wx.Panel):
"""
The Status and Error message window
"""
def __init__(self,parent,colour):
wx.Panel.__init__(self,parent, style=wx.BORDER_SUNKEN)
self.SetBackgroundColour(colour)
box = wx.StaticBox(self,-1,"Status")
self.theText = wx.TextCtrl(self,style=wx.TE_MULTILINE)
#sizer=wx.BoxSizer(wx.VERTICAL)
sizer=wx.StaticBoxSizer(box,wx.VERTICAL)
sizer.Add(self.theText,1,wx.EXPAND|wx.ALL,1)
self.SetSizer(sizer)
sizer.Fit(self)
class myFrame(wx.Frame):
def __init__(self,parent,id):
wx.Frame.__init__(self,parent,id,title="BoxSizer problem")
class MainWin(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1)
splitter = MultiSplitterWindow(self, style=wx.SP_LIVE_UPDATE)
self.splitter = splitter
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(splitter, 1, wx.EXPAND)
self.SetSizer(sizer)
p1=SQLPane(splitter,"light blue")
splitter.AppendWindow(p1, 160)
p2 = SQLPane(splitter, "light blue")
p2.SetMinSize(p2.GetBestSize())
splitter.AppendWindow(p2, 140)
p3 = SQLPane(splitter,"light blue")
splitter.AppendWindow(p3,300)
self.splitter.SetOrientation(wx.VERTICAL)
if __name__ == '__main__':
app=wx.PySimpleApp()
myFrame=myFrame(None,-1)
myPanel=MainWin(myFrame)
myFrame.Show()
app.MainLoop()
···
Begin forwarded message:
From: Jerry LeVan <jerry.levan@gmail.com>
Date: May 19, 2007 10:27:27 PM EDT
To: wxPython-users@lists.wxwidgets.org
Subject: BUG: WxMac and StaticBoxSizers?
Hi,
I am working on an app that consists of a
"mulitsplitter" window with three panes
The top two panels each contain a single
multiline text control and the bottom
panel contains a grid.
I use a static box sizer to emplace a pretty
border around each of the three panels.
The app ( the part that I have done ) works
fine in WinXP and Fedora 6. When I try on the
mac I get evil behavior.
If I click on a different boxed pane to set the focus
to that pane, then the mouse cannot be used
to change the focus to any other boxed pane!
I will try to produce a simpler example but
I suspect (since WinXP and Linux have no problems)
that this is a nasty wxMac but ;(
Thanks,
Jerry