no puedo lograr que el textCtrl rellene el resto de el panel en la clase MDIChildFrame
Código python:
Ver original
# -*- coding: cp1252 -*- import wx ID_TOOL = 1 class prog(wx.MDIParentFrame): def __init__(self): wx.MDIParentFrame.__init__(self, None, -1, title="Mi Aplicacion", size=(500, 620)) #contenedor #menu menubar = wx.MenuBar() file = wx.Menu() file.Append(10, '&Nuevo\tCtrl+N', 'Nuevo Archivo') file.AppendSeparator() file.Append(11, '&Salir\tCtrl+S', 'Salir del programa') ver = wx.Menu() self.toold = ver.Append(ID_TOOL, 'H&erramientas\tCtrl+T', 'Show Toolbox', kind=wx.ITEM_CHECK) self.itool = ver.Append(500, '&Propiedades\tCtrl+U', 'Propiedades', kind=wx.ITEM_CHECK) ver.Check(ID_TOOL, True) help = wx.Menu() help.Append(20, 'A&yuda\tCtrl+H', 'ayuda' ) menubar.Append(file, "&Archivo") menubar.Append(ver, "&Herramientas") menubar.Append(help, 'A&yuda') self.SetMenuBar(menubar) #erramientas self.count = 5 self.toolbar = self.CreateToolBar() self.toolbar.AddLabelTool(wx.ID_ANY, 'Nuevo', wx.Bitmap('icns/Nuevo.png')) self.toolbar.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('icns/Guardar.png')) self.toolbar.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('icns/Abrir.png')) self.toolbar.AddSeparator() self.toolbar.AddLabelTool(30, '', wx.Bitmap('icns/des.png')) self.toolbar.AddLabelTool(31, '', wx.Bitmap('icns/rea.png')) self.toolbar.AddSeparator() self.toolbar.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('icns/Cortar.png')) self.toolbar.AddSeparator() self.toolbar.Realize() #Eventos self.Bind(wx.EVT_MENU, self.OnNuev, id=10) self.Bind(wx.EVT_MENU, self.OnSalir, id=11) self.Bind(wx.EVT_MENU, self.ToogleTool, id=ID_TOOL) self.Bind(wx.EVT_MENU, self.OnDial, id=20) self.Bind(wx.EVT_MENU, self.OnUnd, id=30) self.Bind(wx.EVT_MENU, self.OnRed, id=31) self.Bind(wx.EVT_MENU, self.OnTools, id=500) #mostrar self.Centre() self.CreateStatusBar() #caja de herramientas self.mini = wx.MiniFrame(self, title="Herramientas", size=(300, 560)) self.mini.Bind(wx.EVT_CLOSE, self.OnCloseWindow) #caja self.ids = wx.MiniFrame(self, title="Propiedades", size=(90, 600)) self.ids.Bind(wx.EVT_CLOSE, self.OnCloseWin) def OnCloseWindow(self, event): self.Destroy() def OnCloseWin(self, event): self.Destroy() def OnUnd(self, event): if self.count >1 and self.count <= 5: self.count = self.count - 1 if self.count == 1: self.toolbar.EnableTool(30, False) if self.count == 4: self.toolbar.EnableTool(31, True) def OnRed(self, event): if self.count < 5 and self.count >= 1: self.count = self.count + 1 if self.count == 5: self.toolbar.EnableTool(31, False) if self.count == 2: self.toolbar.EnableTool(30, True) def OnNuev(self, evt): win = wx.MDIChildFrame(self, -1, "Nuevo") panel = wx.Panel(win) #barra de herramientas toolbr = wx.ToolBar(panel, -1) toolbr.AddLabelTool(wx.ID_ANY, 'Nuevo', wx.Bitmap('icns/Nuevo.png')) sample = ['uno', 'dos', 'tres'] wx.StaticText(toolbr, -1, "Modo", (210, 3)) wx.Choice(toolbr, -1, (260, 0), choices = sample) toolbr.Realize() #texto text = wx.TextCtrl(panel, wx.TE_MULTILINE) mains = wx.BoxSizer(wx.VERTICAL) mains.Add(toolbr, 0, wx.EXPAND) asizer = wx.GridSizer(rows=2, hgap=1, vgap=2) asizer.Add(text, 0, wx.EXPAND) mains.Add(asizer, 0, wx.EXPAND|wx.ALL, 1, 5) panel.SetSizer(mains) mains.Fit(win) mains.SetSizeHints(win) win.Show(True) def OnSalir(self, event): self.Close() def OnDial(self, event): dial = wx.MessageDialog(self, 'esta aplicacion es para windows ', 'Acerca de Mi #1er Aplicacion', wx.OK| wx.ICON_EXCLAMATION) dial.ShowModal() def ToogleTool(self, event): if self.toold.IsChecked(): self.mini.Show() else: self.mini.Hide() def OnTools(self, event): if self.itool.IsChecked(): self.ids.Show() else: self.ids.Hide() if __name__ == '__main__': app= wx.App() frame = prog().Show() app.MainLoop()