wxpython 2.9.5 - 'TextCtrl' object has no attribute 'write'

Hi, I have a working script in wxpython 2.9.4, now I am using 2.9.5 on mac
with py2.7, I am now getting this error: 'TextCtrl' object has no attribute
'write'. Here is a small sample of my code:

    def lookupEdit(self, event):
        self.Show()
        self.pathoutdir = wx.TextCtrl(panel, -1, pos=(35, 440), size=(300,
25))
        self.buttonout = wx.Button(panel, -1, "Open", pos=(350, 438))
        self.buttonout.Bind(wx.EVT_BUTTON, self.openoutdir)

    def openoutdir(self, event):
        dlg = wx.DirDialog(self, "Choose your output directory:",
style=wx.DD_DEFAULT_STYLE | wx.DD_NEW_DIR_BUTTON)
        if dlg.ShowModal() == wx.ID_OK:
            global pathoutdir
            pathoutdir = dlg.GetPath()
            self.SetStatusText("Your selected output directory is: %s" %
pathoutdir)
        self.pathoutdir.Clear()
        self.pathoutdir.write(pathoutdir)
        dlg.Destroy()

Is there something I should change in my code to make it work in 2.9.5, or
something I am doing wrong?

kind regards.

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/wxpython-2-9-5-TextCtrl-object-has-no-attribute-write-tp5717972.html
Sent from the wxPython-users mailing list archive at Nabble.com.

OK, found the answer.

I needed to change the line self.pathoutdir.write(pathoutdir) to
self.pathoutdir.WriteText(pathoutdir)

Now all works again, with the added bonus of now having the create new
directory option, which wasn't available in wxpython 2.9.4 on mac.

Cheers.

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/wxpython-2-9-5-TextCtrl-object-has-no-attribute-write-tp5717972p5717974.html
Sent from the wxPython-users mailing list archive at Nabble.com.