Problem w/ Collapsible Pane on Linux
Gregory Bayard
gregory.bayard at gmail.com
Thu Aug 2 07:17:00 PDT 2007
Hi Everyone,
This may be a bug, but I wanted to bounce this off the list first.
When the user expands a collapsible pane, some form of resize event is
generated (which is fine). The problem is that the resize does not
appear to account for the menu bar and the new window size is too
short and cuts off the bottom of my controls or hides the top of my
controls bellow the menu bar.
I'm running this on SuSe Enterprise Linux 9 with Python 2.4.4 and
wxWindows-2.8.4.0. I browsed through the recent changes and did not
see anything related to this. Here is some code which demonstrates my
example, keep in mind this works perfectly on Windows.
<<< BEGIN CODE >>>
import sys
import wx
import wx.grid
class TestPanel(wx.CollapsiblePane):
def __init__(self, parent):
wx.CollapsiblePane.__init__(self, parent, wx.ID_ANY, "Test Panel")
colPane = self.GetPane()
self.testSizer = wx.BoxSizer( wx.VERTICAL )
self.testGrid = wx.grid.Grid(colPane, wx.ID_ANY, size=(100, 150))
self.testGrid.CreateGrid(0, 6)
self.testGrid.SetRowLabelSize(0)
self.testGrid.SetColLabelValue(0, "A")
self.testGrid.SetColLabelValue(1, "B")
self.testGrid.SetColLabelValue(2, "C")
self.testGrid.SetColLabelValue(3, "D")
self.testGrid.SetColLabelValue(4, "E")
self.testGrid.SetColLabelValue(5, "F")
self.testSizer.Add(self.testGrid, 1, wx.EXPAND)
colPane.SetSizer(self.testSizer)
colPane.Fit()
class TestFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent, wx.ID_ANY, "StrategyController")
self.menuBar = wx.MenuBar()
testMenu = wx.Menu()
exitItem = testMenu.Append( wx.ID_ANY, "Exit", "" )
self.menuBar.Append( testMenu, "Test" )
self.SetMenuBar( self.menuBar )
self.Bind( wx.EVT_MENU, self.onExit, exitItem )
self.verticalBox = wx.BoxSizer( wx.VERTICAL )
self.verticalBox.AddSpacer( (2, 2) )
self.testPanel = TestPanel( self )
self.verticalBox.Add( self.testPanel, 0, wx.EXPAND )
self.verticalBox.AddSpacer( (2, 2) )
self.testLabel = wx.TextCtrl( self, wx.ID_ANY, "test bellow
pane", style = wx.TE_READONLY | wx.TE_CENTER )
self.testLabel.SetFont( wx.Font( 9, wx.ROMAN, wx.NORMAL,
wx.NORMAL, False ) )
minHeight = self.testLabel.GetSize()[1] - 2
self.testLabel.SetMinSize( ( 450, minHeight ) )
self.verticalBox.Add( self.testLabel, 0, wx.EXPAND )
self.SetSizer(self.verticalBox)
self.Fit()
def onExit(self, evt):
sys.exit()
class TestApp(wx.App):
def __init__(self):
wx.App.__init__(self)
def OnInit(self):
testFrame = TestFrame(None)
testFrame.Show(True)
return True
if __name__ == '__main__':
app = TestApp()
app.MainLoop()
<<< END CODE >>>
If anyone has any insight on a work around or knows of this as an
existing issue, I'd appreciate feedback.
Thanks,
Greg
More information about the wxpython-users
mailing list