Jack Rodenhi wrote:
class DBObjIO(wxMDIChildFrame):
def __init__(self, parent, ID, title):
wxMDIChildFrame.__init__(self, parent, -1, "MDI Child",
size=(600,400))
scroll = wxScrolledWindow(self,-1)
scroll.tree = wxTreeCtrl(scroll, size=(175,350))
parent = scroll.tree.AddRoot('dir()')
for i in dir():
child = scroll.tree.AppendItem(parent,i)
for j in dir(i):
grandchild = scroll.tree.AppendItem(child,j)
#wxStaticText(self, -1, "Size:",
# wxDLG_PNT(self, wxPoint(4, 4)), wxDefaultSize)
#wxStaticText(self, -1, "Pos:",
# wxDLG_PNT(self, wxPoint(4, 14)), wxDefaultSize)
#self.sizeCtrl = wxTextCtrl(self, -1, "",
# wxDLG_PNT(self, wxPoint(24, 4)),
# wxDLG_SZE(self, wxSize(36, -1)),
# wxTE_READONLY)
#self.posCtrl = wxTextCtrl(self, -1, "",
# wxDLG_PNT(self, wxPoint(24, 14)),
# wxDLG_SZE(self, wxSize(36, -1)),
# wxTE_READONLY)If I run this as it is, I see the tree control. If I remove the comments
so that the whole class runs, I see only the labels and text controls.
You've put the tree on a wxScrolledWindow, but you havn't given the
wxScrolledWindow a position and size on the Frame. When there is nothing
else, it automatically fills the Frame, but when there are other windows
on the Frame, it doesn't know what to do. I'd check out Sizers (and
maybe a wxSashWindow), but for a first stab, you can use absolute
positioning, like you have.
An editorial:
Please don't use MDI-- It's horrible and annoying and I think even
Microsoft has abandoned it.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov