[wxPython-users] finding one item in a wxlistctrl with multiple identical items

Raffaello Barella barbarossa.platz at gmail.com
Thu Feb 28 02:08:15 PST 2008


Set distinctive flags for each entry with SetClientData(), and then scroll
the wxListCtrl with
GetClientData() to find the proper item.

2008/2/27, C M <cmpython at gmail.com>:
>
> Hello,
>
> I'm using a wxListCtrl to list items which will be "active" or "inactive"
> entries.  There may be multiple identical items, but only the final one in
> the list is the active one.  I want to find just that final item, so I can
> modify it.  However, if I use:
>
> list_item =3D self.listCtrl1.FindItem(-1, that_items_string, partial=3DFa=
lse)
>
> I think there is a problem since there are multiple items that match the
> string.  I see that listCtrl has a method, FindItemAtPos(start, point,
> direction), but I don't know how to put in a point and a direction.  Can =
it
> search the list from the end, and just stop when it comes to the first one
> that matches the string?
>
> Of course, if I make this list able to be sorted by clicking on the col
> header such that all the inactive ones are together, it will break this.
> Not good.
>
> So is there a better way to go about this?  I was thinking of just making
> two listCtrls, one for active items and one for inactive ones...that would
> solve the problem, but it might be more effective to see everything on one
> list.  I'm probably missing something obvious.
>
> Thanks,
> Cm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200802=
28/c106143e/attachment.htm


More information about the wxpython-users mailing list