Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/03/2009, 13:00
iozk
 
Fecha de Ingreso: mayo-2008
Mensajes: 499
Antigüedad: 16 años
Puntos: 1
Respuesta: PyQt: Una ventana para gobernarlas a todas... ¿como?

hola yo tambien estoy experimentando con python y uso wxpython
con Qt no se mucho pero creeo que se parece al wxGlade

pero eso es solo para crear interfaces sin ninguna accion bueno yo no se de eso pero investigare...

aqui te dejo un ejemplo de manipular ventanas con wxpython ami se me hace mas simple

Código python:
Ver original
  1. import wx
  2.  
  3.  
  4. class prop(wx.MiniFrame):
  5.     def __init__(self, parent, id):
  6.         wx.MiniFrame.__init__(self, parent, id, title="Hi", style=wx.DEFAULT_FRAME_STYLE)
  7.          
  8. class mini(wx.MiniFrame):
  9.     def __init__(self, parent, id):
  10.         wx.MiniFrame.__init__(self, parent, id, title="yo", style=wx.DEFAULT_FRAME_STYLE)
  11.  
  12. class MDIFrame(wx.MDIParentFrame):
  13.     def __init__(self):
  14.         wx.MDIParentFrame.__init__(self, None, -1, "MDI Parent",
  15.                 size=(600,400))
  16.         menu = wx.Menu()
  17.         self.toold = menu.Append(10, 'H&erramientas\tCtrl+T', 'Show Toolbox', kind=wx.ITEM_CHECK)
  18.         self.itool = menu.Append(500, '&Propiedades\tCtrl+U', 'Propiedades', kind=wx.ITEM_CHECK)
  19.        
  20.         menu.Append(5000, "&New Window")
  21.        
  22.         menu.Append(5001, "E&xit")
  23.         menubar = wx.MenuBar()
  24.         menubar.Append(menu, "&File")
  25.         self.SetMenuBar(menubar)
  26.         self.Bind(wx.EVT_MENU, self.OnNewWindow, id=5000)
  27.         self.Bind(wx.EVT_MENU, self.OnExit, id=5001)
  28.         self.Bind(wx.EVT_MENU, self.ToogleTool, id=10)
  29.         self.Bind(wx.EVT_MENU, self.OnTools, id=500)
  30.  
  31.         self.toolb = mini(self, -1)
  32.  
  33.         self.ids = prop(self, -1)
  34.  
  35.     def OnExit(self, evt):
  36.         self.Close(True)
  37.  
  38.     def OnNewWindow(self, evt):
  39.         win = wx.MDIChildFrame(self, -1, "Child Window")
  40.         win.Show(True)
  41.  
  42.     def ToogleTool(self, event):
  43.         if self.toold.IsChecked():
  44.             self.toolb.Show()
  45.         else:
  46.             self.toolb.Hide()
  47.  
  48.     def OnTools(self, event):
  49.         if self.itool.IsChecked():
  50.             self.ids.Show()
  51.         else:
  52.             self.ids.Hide()
  53.  
  54. if __name__ == '__main__':
  55.     app = wx.PySimpleApp()
  56.     frame = MDIFrame()
  57.     frame.Show()
  58.     app.MainLoop()

esta es lamejor forma de manipular ventanas:)