wxpython and wxtextctrl

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nicolas Pourcelot

    wxpython and wxtextctrl

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

    frame = MyFrame(None,-1,"Geometrie",s ize=wx.Size(600 ,400))
    File "/home/nico/Desktop/wxGeometrie/version 0.73/geometrie.py", line
    74, in __init__
    self.commande.B ind(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
  • Greg Krohn

    #2
    Re: wxpython and wxtextctrl

    Nicolas Pourcelot wrote:[color=blue]
    > Hello,
    > my script worked well until today : when I tried to launch it, I got the
    > following :
    >
    > frame = MyFrame(None,-1,"Geometrie",s ize=wx.Size(600 ,400))
    > File "/home/nico/Desktop/wxGeometrie/version 0.73/geometrie.py", line
    > 74, in __init__
    > self.commande.B ind(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[/color]

    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.__vers ion__
    self.commande.B ind(wx.EVT_CHAR , self.EvtChar)

    -greg

    Comment

    • Nicolas Pourcelot

      #3
      Re: wxpython and wxtextctrl

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

      Greg Krohn a écrit :[color=blue]
      > Nicolas Pourcelot wrote:
      >[color=green]
      >> Hello,
      >> my script worked well until today : when I tried to launch it, I got
      >> the following :
      >>
      >> frame = MyFrame(None,-1,"Geometrie",s ize=wx.Size(600 ,400))
      >> File "/home/nico/Desktop/wxGeometrie/version 0.73/geometrie.py",
      >> line 74, in __init__
      >> self.commande.B ind(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[/color]
      >
      >
      > 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.__vers ion__
      > self.commande.B ind(wx.EVT_CHAR , self.EvtChar)
      >
      > -greg
      >[/color]

      Comment

      Working...