Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/09/2011, 09:24
Avatar de bosterkill
bosterkill
 
Fecha de Ingreso: mayo-2011
Mensajes: 56
Antigüedad: 13 años
Puntos: 0
duda codigo para creacion de 2 frames

Hola colegas espero se encuentren bien, les escribo para aclarar dudas tengo un codigo el cual el objetivo es abrir el cuadro principal maximizado y un cuadro pequeño centrado destinado a un login.

tengo mi codigo

Código Python:
Ver original
  1. #!/usr/bin/python
  2.  
  3.  
  4. # Doble.py
  5.  
  6. import wx
  7.  
  8. class MyFrame(wx.Frame):
  9.     def __init__(self, parent, id, title):
  10.         wx.Frame.__init__(self, parent, id, title, size = (600,400), style =wx.SYSTEM_MENU | wx.RESIZE_BORDER | wx.CAPTION | wx.MINIMIZE_BOX)
  11.         panel = wx.Panel(self, -1)
  12.        
  13.         self.Menu()
  14.         self.Centre()
  15.         self.Maximize()
  16.         self.Show()
  17.        
  18.     def Menu(self):
  19.         barramenu = wx.MenuBar()
  20.         fileMenu = wx.Menu()
  21.         fitem = fileMenu.Append(wx.ID_EXIT, "QUIT", "Quit Application")
  22.         barramenu.Append(fileMenu, "&FILE")
  23.         self.SetMenuBar(barramenu)
  24.        
  25.        
  26.     def OnQuit(self, evt):
  27.         self.Close()
  28.    
  29.        
  30. class MyFrame2(wx.Frame):
  31.     def __init__(self, parent, id, title):
  32.         wx.Frame.__init__(self, parent, id, title, size = (400,200), style = wx.SYSTEM_MENU | wx.RESIZE_BORDER | wx.CAPTION)
  33.         panel = wx.Panel(self, -1)
  34.        
  35.         usuario = wx.StaticText(panel, -1, "Usuario ", pos = (100,30))
  36.         contrasena = wx.StaticText(panel, -1, " Contraseña: ", pos = (100,50))
  37.         self.Centre()
  38.         self.Show()
  39.    
  40.                
  41.                
  42.                
  43.                
  44. app = wx.App()
  45. MyFrame(None, -1, "Doble")
  46. MyFrame2(None, -1, "usuarios")
  47. app.MainLoop()

y creo que voy bien pero al ejecutar me abre 2 ventanas totalmente independientes cosa que no deseo :S

ojala puedan ayudarme para juntas esas 2 ventanas en 1 sola

saludos