Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/10/2008, 11:44
iozk
 
Fecha de Ingreso: mayo-2008
Mensajes: 499
Antigüedad: 15 años, 11 meses
Puntos: 1
Pregunta ayuda con codigos

hola tengo este codigo y quiero que haga lo que hace el otro pero no se como acomodarlos quiero ponerle el codigo que hace crear otra ventana de este al otro pero no se como hacerlo

de este

Código python:
Ver original
  1. import wx
  2.  
  3. class MDIFrame(wx.MDIParentFrame):
  4.     def __init__(self, parent, id, title):
  5.         wx.MDIParentFrame.__init__(self, parent, id, title, size=(600,400))
  6.        
  7.         menu = wx.Menu()
  8.         menu.Append(5000, "&New Window\tCtrl+N", 'New window')
  9.         menu.Append(100, "&Save\tCtrl+S", 'Seve file')
  10.         menu.Append(5001, '&Quit\tCtrl+Q', 'Close the program')
  11.         menubar = wx.MenuBar()
  12.         menubar.Append(menu, "&File")
  13.         self.SetMenuBar(menubar)
  14.  
  15.        
  16.         self.Bind(wx.EVT_MENU, self.OnNewWindow, id=5000)
  17.         self.Bind(wx.EVT_MENU, self.OnExit, id=5001)
  18.  
  19.         self.CreateToolBar(wx.EXPAND)
  20.         self.CreateStatusBar()
  21.         self.Show(True)
  22.  
  23.     def OnExit(self, evt):
  24.         self.Close(True)
  25.  
  26.     def OnNewWindow(self, evt):
  27.         win = wx.MDIChildFrame(self, -1, "Child Window")
  28.         wx.TextCtrl(win, -1, style= wx.TE_MULTILINE)
  29.         win.Show(True)
  30.  
  31.  
  32.  
  33. app = wx.PySimpleApp()
  34. MDIFrame(None, -1, 'non')
  35. app.MainLoop()


a este

Código python:
Ver original
  1. import wx
  2.  
  3.  
  4. class Toolbars(wx.Frame):
  5.     def __init__(self, parent, id, title):
  6.         wx.Frame.__init__(self, parent, id, title, size=(700, 650))
  7.        
  8.         menubar = wx.MenuBar()
  9.         file = wx.Menu()
  10.         new = wx.MenuItem(file, 2, '&New\tCtrl+N', 'new file')
  11.         file.AppendItem(new)
  12.         file.AppendSeparator()
  13.         quit = wx.MenuItem(file, 1, '&Quit\tCtrl+Q', 'Exit program')
  14.         file.AppendItem(quit)
  15.        
  16.         edit = wx.Menu()
  17.         copy = wx.MenuItem(edit, 3, '&Copy\tCtrl+C', 'Copy selected')
  18.         edit.AppendItem(copy)
  19.         cut = wx.MenuItem(edit, 4, '&Cut\tCtrl+X', 'Cut selected')
  20.         edit.AppendItem(cut)
  21.        
  22.        
  23.         menubar.Append(file, '&File')
  24.         menubar.Append(edit, '&Edit')
  25.         self.SetMenuBar(menubar)
  26.  
  27.         self.Bind(wx.EVT_MENU, self.OnQuit, id=1)
  28.  
  29.         vbox = wx.BoxSizer(wx.VERTICAL)
  30.  
  31.         toolbar1 = wx.ToolBar(self, 1)
  32.         toolbar1.AddLabelTool(wx.ID_EXIT, '', wx.Bitmap('../Lamp/exit.png'))
  33.         toolbar1.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('../lamp/exit.png'))
  34.         toolbar1.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('../lamp/exit.png'))
  35.         toolbar1.Realize()
  36.  
  37.         toolbar2 = wx.ToolBar(self, 1)
  38.         toolbar2.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('../lamp/exit.png'))
  39.         wx.ComboBox(toolbar2, pos=(100, 0))
  40.         toolbar2.Realize()
  41.        
  42.  
  43.         vbox.Add(toolbar1, 0, wx.EXPAND)
  44.         vbox.Add(toolbar2, 0, wx.EXPAND)
  45.        
  46.  
  47.         self.Bind(wx.EVT_TOOL, self.OnExit, id=wx.ID_EXIT)
  48.  
  49.        
  50.         self.SetSizer(vbox)
  51.         self.statusbar = self.CreateStatusBar()
  52.         self.Centre()
  53.         self.Show(True)
  54.  
  55.  
  56.     def OnExit(self, event):
  57.         self.Close()
  58.  
  59.     def OnQuit(self, event):
  60.         self.Close()
  61.  
  62.  
  63. app = wx.App()
  64. Toolbars(None, -1, 'Universal Grapics')
  65. app.MainLoop()