[wxPython-users] get wxListCtrl from wxListItem?

Rich Shepard rshepard at appl-ecosys.com
Tue Jan 2 11:14:12 PST 2007


On Tue, 2 Jan 2007, Pangborn, Andrew (ext. 324) wrote:

> I'm using multiple list controls as elements on a CustomTreeCtrl...so I
> would still need some way of determining what listctrl the Listitem
> belonged to. I am able to get the value from the listCtrl cell that was
> edited with event.GetText(), its just a matter of getting a reference to
> the proper python data object so that I can persist changes to my model.
> It's pretty easy for me to tack on a pyData object to the listctrl, but I
> don't really know how to tack a pyData object onto the listitem.

Andrew,

   Perhaps I'm not understanding your situation. Chapter 15 of the wxPIA book
explains how to find children of a parent, but with a quick review I don't see
how to identify the parent from the selected child. The API page probably
has an easier to read list of methods.

> I'm using listCtrl.SetStringItem, which seems to create the ListItem
> internally without returning a reference.

   Are you assigning that to a variable? a = listCtrl.SetStringItem() doesn't
give you what you need?

   Sorry I mis-understood your needs.

Rich

-- 
Richard B. Shepard, Ph.D.               |    The Environmental Permitting
Applied Ecosystem Services, Inc.        |          Accelerator(TM)
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863




More information about the wxpython-users mailing list