Traceback (most recent call last):
File "C:\Python25\w-xprog.py", line 49, in OnNuev
new = wx.MDIChildFrame(self)
File "C:\Python25\lib\site-packages\wx-2.8-msw-ansi\wx\_windows.py", line 3303, in __init__
_windows_.MDIChildFrame_swiginit(self,_windows_.ne w_MDIChildFrame(*args, **kwargs))
TypeError: in method 'new_MDIChildFrame', expected argument 1 of type 'wxMDIParentFrame *'
mi codigo es este tambien no sale el boton de cerrar al MiniFrame
Código python:
Ver original
# serie de nero 1A20-020E-0000-1349-1210-6697 import wx ID_TOOL = 1 class prog(wx.MDIParentFrame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(500, 620)) #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. shst = ver.Append(ID_TOOL, 'herramientas\tCtrl+T', 'Show Toolbox', 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, "V&er") menubar.Append(help, 'A&yuda') self.SetMenuBar(menubar) #erramientas toolbar = wx.ToolBar(self) toolbar.AddLabelTool(wx.ID_ANY, 'Nuevo', wx.Bitmap('icns/Nuevo.png')) toolbar.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('icns/Guardar.png')) toolbar.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('icns/Abrir.png')) toolbar.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('icns/Cortar.png')) 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) #mostrar self.Centre() self.CreateStatusBar() self.Show(True) self.mini = wx.MiniFrame(self, -1, "ToolBox", size=(130, 230)) self.pnl = wx.Panel(self.mini) def OnNuev(self, evt): new = wx.MDIChildFrame(self) new.Show(True) def OnSalir(self, event): self.Close() def OnDial(self, event): dial = wx.Dialog(self) dial.Show(True) def ToogleTool(self, event): if self.shst.IsChecked(): self.mini.Show() else: self.mini.Hide() app = wx.App() prog(None, -1, 'Mi aplicacion #1') app.MainLoop()