Ver Mensaje Individual
  #2 (permalink)  
Antiguo 13/10/2011, 14:06
Avatar de bosterkill
bosterkill
 
Fecha de Ingreso: mayo-2011
Mensajes: 56
Antigüedad: 13 años
Puntos: 0
Respuesta: problema llamar clase

Lamento hacer el post..

luego de leer mucho pero mucho el codigo era un simple error ya lo solucione

Código Python:
Ver original
  1. # -*- coding: cp1252 -*-
  2. #!usr/bin/python
  3. # prueba.py
  4. import wx
  5.  
  6. class Frame2(wx.Frame):
  7.     def __init__(self, parent):
  8.         self.padre = parent
  9.         wx.Frame.__init__(self, None, -1, "Titulo")
  10.         panel = wx.Panel(self, -1)
  11.        
  12.  
  13.  
  14. class MyFrame(wx.Frame):
  15.     def __init__(self, parent, id, title):
  16.        
  17.         wx.Frame.__init__(self, parent, id, title)
  18.         panel = wx.Panel(self, -1)
  19.         #Textos estaticos
  20.         usuario = wx.StaticText(panel, -1, "Usuario:", pos = (130,100))
  21.         password = wx.StaticText(panel, -1, "Contraseña:", pos = (110,150))
  22.         #Cajas de texto
  23.         c_usuario = wx.TextCtrl(panel, -1, "", pos = (170,100))
  24.         c_pass = wx.TextCtrl(panel, -1, "", pos = (170,150), style = wx.PASSWORD)
  25.         #Botones
  26.         cerrar = wx.Button(panel, -1, "Cerrar", pos = (250,300))
  27.         aceptar = wx.Button(panel, -1, "Aceptar", pos = (150,300))
  28.         nuevo = wx.Button(panel, -1, "Nuevo", pos =(50,300))
  29.         nuevo.Bind(wx.EVT_BUTTON, self.OnNuevo)
  30.         cerrar.Bind(wx.EVT_BUTTON, self.OnCerrar)
  31.         self.Centre()
  32.         self.Show()
  33.        
  34.  
  35.     def OnNuevo(self, event):
  36.         frame = Frame2(self)
  37.         frame.Show()
  38.  
  39.        
  40.     def OnCerrar(self, event):
  41.         self.Destroy()
  42.  
  43.  
  44. app = wx.PySimpleApp()
  45. MyFrame(None, -1, "Titulo")
  46. app.MainLoop()