Paso de parametros

FERNANDO VILLARROEL fvillarroel en yahoo.com
Lun Nov 15 22:47:52 CET 2004


Hola no logro pasar parametros o variables entre
formularios wxPython, se puede?, como se hace?

Tengo el siguiente ejemplo

class MyDialog1(wx.Dialog):
    def __init__(self, *args, **kwds):
        # begin wxGlade: MyDialog1.__init__
        kwds["style"] = wx.DIALOG_MODAL|wx.CAPTION
        wx.Dialog.__init__(self, *args, **kwds)
        self.label_3 = wx.StaticText(self, -1,
"AUTENTIFICACION USUARIOS")
        b=[]
        EVT_BUTTON (self, self.button_1.GetId(),
self.OnConectar)
        EVT_TEXT_ENTER (self,self.text_ctrl_1.GetId(),
self.OnEnt)
        EVT_TEXT_ENTER (self,self.text_ctrl_2.GetId(),
self.OnEnt1)
        EVT_BUTTON (self, self.button_2.GetId(),
self.OnSalir)


frame=MyFrame(self,b[2],-1,"CHEVALIER")
self.Centre(frame)
frame.Show()
self.Destroy()

Luego la clase my frame que previamente importe con
from MyFrame import MyFrame

class MyFrame(wx.Frame,):
    def __init__(self, suc, *args, **kwds):
        # begin wxGlade: MyFrame.__init__
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, suc, *args, **kwds)


Me tira el siguiente error:

raceback (most recent call last):
  File "conecta.py", line 94, in OnConectar
    frame=MyFrame(self,f,-1,"CHEVALIER")
  File "/home/developer/prueba/MyFrame.py", line 14,
in __init__
    wx.Frame.__init__(self, suc, *args, **kwds)
  File
"/usr/lib/python2.3/site-packages/wxPython/frames.py",
line 151, in __init__
    self.this = framesc.new_wxFrame(*_args,**_kwargs)
TypeError: String or Unicode type required


Por favor si alguien me puede ayudar no logro pasar
parametros entre formularios.

Fernando Villarroel N.


		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 

------------ próxima parte ------------
_______________________________________________
Python-es mailing list
Python-es en aditel.org
http://listas.aditel.org/listinfo/python-es


Más información sobre la lista de distribución Python-es