Re: AttributeError: 'TreeCtrl' object has no attribute 'GetItem'

Tim Roberts <[email protected]> Wed, 21 Apr 2021 09:15:14 -0700
Newsgroups gmane.comp.python.wxpython
Organization Providenza & Boekelheide, Inc.
Message-ID <[email protected]>
RF wrote:
> So I've googled around on this error and found some others who've had 
> this problem. But I can't seem to solve it for my own app.
>
> I get the error from the bind event: def OnSelChanged(self, event):
> ...
> def OnSelChanged(self, event):
>      item = event.GetItem()
> print(self.tree.GetItemText(item))

Well, the error is correct.  The wx.TreeCtrl object does not have a 
GetItem method.  What are you trying to do here?  Is it possible you 
wanted GetSelection() instead?

-- 
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.

-- 
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/0bf5be0b-f038-9d81-5fcb-c135ef3ced74%40probo.com.
smime.p7s (application/pkcs7-signature, 3.3 KB) - not displayed