Why wxTreeCtrl Show very small?

···

import wx
import wx.aui

class MyFrame(wx.Frame):
def init(self, parent, id=-1, title=‘DiagGUI’,
pos=wx.DefaultPosition, size=(800, 600),
style=wx.DEFAULT_FRAME_STYLE):
wx.Frame.init(self, parent, id, title, pos, size, style)
self.ServePanel = wx.Panel(self, -1,wx.DefaultPosition, (200,150))
self.ControlPanel = wx.Panel(self, -1,wx.DefaultPosition, (200,150))
self.OutputText = wx.TextCtrl(self, -1, ‘Output Window’,
wx.DefaultPosition, (200,150),
wx.TE_RICH2 | wx.TE_MULTILINE)
self.tree = wx.TreeCtrl(self.ServePanel)
self.root = self.tree.AddRoot(“SERVES”)
self.diag = self.tree.AppendItem(self.root,“diag”)
self.bootload = self.tree.AppendItem(self.root,“bootload”)
self.bootload1 = self.tree.AppendItem(self.bootload,“bootload1”)
self.tree.Expand(self.root)
self._mgr = wx.aui.AuiManager(self)
self._mgr.AddPane(self.ControlPanel, wx.aui.AuiPaneInfo().Center())
self._mgr.AddPane(self.ServePanel, wx.aui.AuiPaneInfo().Left())
self._mgr.AddPane(self.OutputText, wx.aui.AuiPaneInfo().Bottom())
self._mgr.Update()

if name == “main”:
app = wx.App()
frame = MyFrame(None)
frame.Show()
app.MainLoop()

uhmm.. maybe because you dont set his sizes?

Saludos / Best regards

Mario Lacunza
Email:: mlacunza@gmail.com
Personal Website:: http://www.lacunza.biz/
OpenOffice.org Perú:: http://openoffice-peru.com/
Hosting:: http://mlv-host.com/
Mascotas Perdidas:: http://mascotas-perdidas.com/
Google Talk / Y! messenger / Skype: mlacunzav
MSN: mlacunzav@hotmail.com

···

El 21/12/12 10:55, Tom.Yang escribió:

<https://lh4.googleusercontent.com/-1ArEAvRJHR4/UNSFij3tNaI/AAAAAAAAAVE/oxx5wMum7BM/s1600/tree.jpg&gt;

        import wx

        import wx.aui

        class MyFrame(wx.Frame):

        def __init__(self, parent, id=-1, title='DiagGUI',

                   pos=wx.DefaultPosition, size=(800, 600),

                   style=wx.DEFAULT_FRAME_STYLE):

          wx.Frame.__init__(self, parent, id, title, pos, size, style)

          self.ServePanel = wx.Panel(self, -1,wx.DefaultPosition,
        (200,150))

          self.ControlPanel = wx.Panel(self, -1,wx.DefaultPosition,
        (200,150))

          self.OutputText = wx.TextCtrl(self, -1, 'Output Window',

                              wx.DefaultPosition, (200,150),

                               wx.TE_RICH2 | wx.TE_MULTILINE)

          self.tree = wx.TreeCtrl(self.ServePanel)

          self.root = self.tree.AddRoot("SERVES")

          self.diag = self.tree.AppendItem(self.root,"diag")

          self.bootload = self.tree.AppendItem(self.root,"bootload")

          self.bootload1 = self.tree.AppendItem(self.bootload,"bootload1")

          self.tree.Expand(self.root)

          self._mgr = wx.aui.AuiManager(self)

          self._mgr.AddPane(self.ControlPanel,
        wx.aui.AuiPaneInfo().Center())

          self._mgr.AddPane(self.ServePanel, wx.aui.AuiPaneInfo().Left())

          self._mgr.AddPane(self.OutputText,
        wx.aui.AuiPaneInfo().Bottom())

          self._mgr.Update()

        if __name__ == "__main__":

        app = wx.App()

        frame = MyFrame(None)

        frame.Show()

        app.MainLoop()

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Give self.ServePanel a sizer, and put self.tree in the sizer such that it will be expanded to fill the area given to the sizer.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org