Help for access method of wxPython object

Franz GEIGER fgeiger at datec.at
Tue Apr 24 14:56:17 EDT 2001


Had a similar problem. Thanks to Robin Dunn, he showed me how to solve it:
You have to use Getters like this, to access the control:

def GetTextctrlText(self):
   return wxPyTypeCast( self.FindWindowById(ID_TEXTCTRL_TEXT),
"wxTextCtrl" )

wxDesigner(), which I really can recommend, did this for me by a simple
button click.

See the related thread on this:
http://groups.google.com/groups?hl=en&lr=&safe=off&ic=1&th=40bf7162e9580db9&
seekd=909081131#909081131

Hope this helps.

Best Regards
Franz GEIGER

"Neotaku" <neotaku at free.fr> wrote in message
news:CieF6.475$6H6.2077927 at nnrp3.proxad.net...
>
> Hello,
>
>     Here is my problem, i take an object control from a windows like this
>     obj = self.GetChildren()[26]
>     print obj.GetName()
>
>     self is a windows and the 26th object is a textcontrol. so this code
> work well and i can get the control's name but when i want to do that :
>     obj.SetValue("Testing")
>
>     i have always this error : AttributeError : 'wxWindowPtr' instance has
> no attribute 'SetValue'
>     i don't understand why it doesn't work ? the only way it can work is
> like this : self.MyTextCtrl.SetValue("Testing")
>
> Thanks a lot for you help
>
> Using : wxPython, Boa Constructor, NT4 Win32
>





More information about the Python-list mailing list