Paso de parametros

Luis Lopez glav en mexico.com
Mar Nov 16 00:47:06 CET 2004


Yo lo hago de la siguiente manera:

en la llamada a otro formulario

class cPrincipal(wx.Frame):
        .
        .
        captura = cCaptura(self.usr, self.mov, None, -1, "")
        captura.ShowModal()

donde self.usr y self.mov son mis variables del primer formulario.

Y en la definicion del segundo formulario:

class cCaptura(wx.Dialog):
    def __init__(self, usr, mov, *args, **kwds):
        self.usr = usr
        self.mov = mov
        # begin wxGlade: cCaptura.__init__

No debes pober el "self" cuando pasas paramentro a otra funcion.



----- Original Message -----
From: FERNANDO VILLARROEL <fvillarroel en yahoo.com>
To: python-es en aditel.org
Subject: [Python-es] Paso de parametros 
Date: Mon, 15 Nov 2004 13:47:52 -0800 (PST)

Re: 
Re: Hola no logro pasar parametros o variables entre
Re: formularios wxPython, se puede?, como se hace?
Re: 
Re: Tengo el siguiente ejemplo
Re: 
Re: class MyDialog1(wx.Dialog):
Re:     def __init__(self, *args, **kwds):
Re:         # begin wxGlade: MyDialog1.__init__
Re:         kwds["style"] = wx.DIALOG_MODAL|wx.CAPTION
Re:         wx.Dialog.__init__(self, *args, **kwds)
Re:         self.label_3 = wx.StaticText(self, -1,
Re: "AUTENTIFICACION USUARIOS")
Re:         b=[]
Re:         EVT_BUTTON (self, self.button_1.GetId(),
Re: self.OnConectar)
Re:         EVT_TEXT_ENTER (self,self.text_ctrl_1.GetId(),
Re: self.OnEnt)
Re:         EVT_TEXT_ENTER (self,self.text_ctrl_2.GetId(),
Re: self.OnEnt1)
Re:         EVT_BUTTON (self, self.button_2.GetId(),
Re: self.OnSalir)
Re: 
Re: 
Re: frame=MyFrame(self,b[2],-1,"CHEVALIER")
Re: self.Centre(frame)
Re: frame.Show()
Re: self.Destroy()
Re: 
Re: Luego la clase my frame que previamente importe con
Re: from MyFrame import MyFrame
Re: 
Re: class MyFrame(wx.Frame,):
Re:     def __init__(self, suc, *args, **kwds):
Re:         # begin wxGlade: MyFrame.__init__
Re:         kwds["style"] = wx.DEFAULT_FRAME_STYLE
Re:         wx.Frame.__init__(self, suc, *args, **kwds)
Re: 
Re: 
Re: Me tira el siguiente error:
Re: 
Re: raceback (most recent call last):
Re:   File "conecta.py", line 94, in OnConectar
Re:     frame=MyFrame(self,f,-1,"CHEVALIER")
Re:   File "/home/developer/prueba/MyFrame.py", line 14,
Re: in __init__
Re:     wx.Frame.__init__(self, suc, *args, **kwds)
Re:   File
Re: "/usr/lib/python2.3/site-packages/wxPython/frames.py",
Re: line 151, in __init__
Re:     self.this = framesc.new_wxFrame(*_args,**_kwargs)
Re: TypeError: String or Unicode type required
Re: 
Re: 
Re: Por favor si alguien me puede ayudar no logro pasar
Re: parametros entre formularios.
Re: 
Re: Fernando Villarroel N.
Re: 
Re: 
Re: 		
Re: __________________________________ 
Re: Do you Yahoo!? 
Re: The all-new My Yahoo! - Get yours free! 
Re: http://my.yahoo.com 
Re:  
Re: 
Re: 

Re:
Re: 
Re: _______________________________________________
Re: Python-es mailing list
Re: Python-es en aditel.org
Re: http://listas.aditel.org/listinfo/python-es
Re: 



--------------------------------------------------
Luis Antonio Lopez V.
glav en mexico.com

-- 
_______________________________________________
http://mail.mexico.com
¡Disponible Ya! Utiliza el Outlook y Outlook Express para bajar tus correos por solo US$24.95 al año

Now available! Download your mail into your computer with Outlook and Outlook Express US$24.95/yr

Powered by www.M3xico.com




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