Dear wxPython Users,
I am new to wxPython and I have a question that doesn't appear in any examples.
I created two sash windows which appears okay, but when I reshape the sash windows nothing
happens unless I resize the parent "wxFrame" window. I am using using wxLayoutConstraints
instead of wxLayoutAlgorithm.
How can I get the sash windows to change like the demo example?
----------------Sample Code-----------------------
def cre_panel_1( self ):
self.panelA = wxSashLayoutWindow( self, 1252, wxDefaultPosition,
wxDefaultSize, wxSW_3D )
lc = wxLayoutConstraints()
lc.top.SameAs( self, wxTop, 5 )
lc.left.SameAs( self, wxLeft, 5 )
lc.right.SameAs( self, wxRight, 5 )
lc.bottom.PercentOf( self, wxHeight, 20 )
self.panelA.SetConstraints( lc )
self.panelA.SetOrientation(wxLAYOUT_HORIZONTAL)
self.panelA.SetAlignment(wxLAYOUT_BOTTOM)
self.panelA.SetBackgroundColour(wxColour(255, 0, 0))
self.panelA.SetSashVisible(wxSASH_BOTTOM, true)
self.panelA.SetExtraBorderSize(10)
EVT_SASH_DRAGGED(self, 1252, self.ResizeMiddleBottom)
···
#---------------------------------------------------------------------
def cre_panel_2( self ):
self.panelB = wxSashLayoutWindow( self, 1253, wxDefaultPosition,
wxDefaultSize, wxSW_3D )
lc = wxLayoutConstraints()
lc.top.Below( self.panelA, 5 )
lc.left.SameAs( self, wxLeft, 5 )
lc.right.SameAs( self, wxRight, 5 )
lc.bottom.PercentOf( self, wxHeight, 35 )
self.panelB.SetConstraints( lc )
self.panelB.SetOrientation(wxLAYOUT_HORIZONTAL)
self.panelB.SetAlignment(wxLAYOUT_BOTTOM)
self.panelB.SetBackgroundColour(wxColour(0, 255, 0))
self.panelB.SetSashVisible(wxSASH_BOTTOM, true)
#---------------------------------------------------------------------
def ResizeMiddleBottom(self, event):
a= event.GetDragRect().height/300.*50
lc = wxLayoutConstraints()
lc.top.SameAs( self, wxTop, 5 )
lc.left.SameAs( self, wxLeft, 5 )
lc.right.SameAs( self, wxRight, 5 )
lc.bottom.PercentOf( self, wxHeight, a )
self.panelA.SetConstraints( lc )
--
Dean N. Williams
Computer Scientist/Computation Group Leader o
Lawrence Livermore National Laboratory --
Livermore, California 94550 `\< *
Phone: (925) 423-0145 FAX: (925) 422-7675 / \
http://www-pcmdi.llnl.gov williams13@llnl.gov
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users