RES: RES: [wxPython-users] How to pass data to a frame
Alejandro Michelin Salomon ( Adinet )
alejmsg at adinet.com.uy
Fri Jul 14 11:04:47 PDT 2006
I modify your code.
The only modification is, the method is call in the caller function in the
menu module.
# Orignal
def OnSystemsSystems_newMenu(self, event):
import systems_new
oSystmesForm = systems_new.create(self)
oSystmesForm.Show()
return True
# Actualy
def OnSystemsSystems_newMenu(self, event):
import systems_new
oSystmesForm = systems_new.create(self)
data = ('a description', 'some text') # just for testing
oSystmesForm.LoadData(data)
oSystmesForm.Show()
return True
Thanks a lot for your help.
Alejandro.
-->-----Mensagem original-----
-->De: Werner F. Bruhin [mailto:werner.bruhin at free.fr]
-->Enviada em: sexta-feira, 14 de julho de 2006 14:43
-->Para: wxPython-users at lists.wxwidgets.org
-->Assunto: Re: RES: [wxPython-users] How to pass data to a frame
-->
-->
-->Alejandro,
-->
-->Alejandro Michelin Salomon ( Adinet ) wrote:
-->
-->>This is de code generated by boa constructor :
-->>
-->>
-->Not quit everything, is it :-) .
-->
-->I attached (much better/easier, just do a save as and run
-->it) a modified
-->version.
-->
-->I am not sure why you want to pass something to the
-->constructor of the
-->frame, I guess that you really want to load some data into
-->the controls
-->on your frame.
-->
-->Depending were this data is coming from you have many options.
-->- if it comes from a database I would probably use
-->validators, at least
-->I do in my app. Check out LoadDataToWindow and
-->LoadDataFromWindow and
-->InitDialog.
-->- you could also create a method in your frame which you
-->call to load
-->the data into the controls - this is what the attached sample does -
-->very simplistic.
-->- I am sure there are other ways
-->
-->You might want to check out the following resources:
-->
-->http://wiki.wxpython.org/
-->gmane.comp.ide.boa-constructor.user - subscribe to this
-->list for boa
-->specific questions
-->The wxPython in Action book - check on the wxPython site
-->
-->Hope this helps
-->Werner
-->
More information about the wxpython-users
mailing list