I switch between a ScrolledWindow and a TreeCtrl in my app by
showing/hiding the tree control as needed. I have to test for
mode in a few places, but it has worked fairly well. A couple
of code snippets follow to give you the flavor.
Phil Mayes
def OnSize(self, evt):
"""
Called when the window is
resized. We set a flag so the idle
handler will resize the
buffer.
"""
# Lay out the parent frame,
else EventWnd overlaps descwnd and controlwnd.
# Seems weird to have to do
this all the way down at this level.
mf =
wx.GetApp().GetMainFrame()
mf._LayoutFrame()
if self.mode ==
gbl.VIEWTREE:
if
self.tree:
size = self.GetParent().GetClientSize()
self.tree.SetSize(size)
else:
self.reInitBuffer = True
def OnViewType(self, evt):
_id = evt.GetId()
wx.GetApp().ShowHelp(_modehelp[_id])
# if moving away from tree,
hide it
if self.mode ==
gbl.VIEWTREE:
self.ShowTree(False)
self.mode = _id
# if moving to time view, flat
OR nested, show it
if _id != gbl.VIEWTREE:
self.scale.SetMode(self.mode)
self._sel = None
self.ShowSel()
pxvb =
self.vsize
in pixels
sxvb =
self.vsize/HRES
in scroll units
self.SetScrollbars(HRES,VRES, sxvb,self.scale.ymax, 0,0)
self.ReCalcLayout()
self.reInitBuffer = True
# if moving to tree, show
it
if _id == gbl.VIEWTREE:
self.SetScrollbars(1,1, 0,0, 0,0)
self.csr = gbl.TREE
self.ShowCursor()
self.ShowTree(True)
···
At 08:19 PM 5/3/2006, you wrote:
Hi
All,
I need to switch between a treecontrol and a
list control in my frame . do we have something similar to bring to front
and send to back in wxpython as we have for a panel in
delphi…
any suggestions on how to handle
this.
cheers
Thomas Thomas
phone +64 7 855 8478
fax +64 7 855
8871