wxpython and wxtextctrl

N

Nicolas Pourcelot

Hello,
my script worked well until today : when I tried to launch it, I got the
following :

frame = MyFrame(None,-1,"Geometrie",size=wx.Size(600,400))
File "/home/nico/Desktop/wxGeometrie/version 0.73/geometrie.py", line
74, in __init__
self.commande.Bind(wx.EVT_CHAR, self.EvtChar)
AttributeError: wxTextCtrl instance has no attribute 'Bind'

(self.commande is a wxTextCtrl instance)
I don't understand : why did wxTextCtrl lost its Bind attribute ??
As there's not so much changes on my computer since yesterday, I suppose
this is due to Boa package installation on my Ubuntu Hoary ?
Does Boa installation changes wxpython version ?
Is wxTextCtrl attribute .Bind() obsolete ??

Thanks,
Nicolas
 
G

Greg Krohn

Nicolas said:
Hello,
my script worked well until today : when I tried to launch it, I got the
following :

frame = MyFrame(None,-1,"Geometrie",size=wx.Size(600,400))
File "/home/nico/Desktop/wxGeometrie/version 0.73/geometrie.py", line
74, in __init__
self.commande.Bind(wx.EVT_CHAR, self.EvtChar)
AttributeError: wxTextCtrl instance has no attribute 'Bind'

(self.commande is a wxTextCtrl instance)
I don't understand : why did wxTextCtrl lost its Bind attribute ??
As there's not so much changes on my computer since yesterday, I suppose
this is due to Boa package installation on my Ubuntu Hoary ?
Does Boa installation changes wxpython version ?
Is wxTextCtrl attribute .Bind() obsolete ??

Thanks,
Nicolas

control.Bind is relativly new. The wxTextCtrl notation (vs wx.TextCtrl) is
the old way (but it IS kept around for backwards compatablility). My guess
is that your code is for for a newer version of wxPython than what you
actually have.

Try printing the version from in your code:

import wxPyhon
print wxPython.__version__
self.commande.Bind(wx.EVT_CHAR, self.EvtChar)

-greg
 
N

Nicolas Pourcelot

Ok, as I guessed, it was Boa installation which changed the wxpython
version used.
I removed Boa...
Thanks !
Nicolas

Greg Krohn a écrit :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,209
Messages
2,571,089
Members
47,689
Latest member
kilaocrhtbfnr

Latest Threads

Top