Newbie wxPython ListCtrl Question

Todd7 nospam at please.net
Wed Nov 16 20:19:33 EST 2005


Thank you very much.  That is exactly what I needed.

limodou <limodou at gmail.com> wrote in
news:mailman.773.1132189602.18701.python-list at python.org: 

> 2005/11/17, Todd7 <nospam at please.net>:
>> I am new to python and to wxWindows.  I have tried searching google,
>> reading the documentation and trying to figure out some of the
>> examples, but I am stumped as to how to get information out of a
>> listctrl at a certain row and column.  I tried to write a simple
>> example to learn to work with the listctrl as follows:
> 
> I'v made some helper function as that:
> 
>     def getRowText(self, index, col):
>         if index >= 0:
>             return self.list_ctrl_1.GetItem(index, col).GetText()
>         else:
>             return ''
> 
>     def getSelRowText(self, col):
>         return self.getRowText(self.getSelection(), col)
> 
>     def getSelection(self):
>         return self.list_ctrl_1.GetNextItem(-1, wx.LIST_NEXT_ALL,
> wx.LIST_STATE_SELECTED)
> 
> You can just use self.getSelRowText(1) to gain the second column text
> of selection row.
> --
> I like python!
> My Blog: http://www.donews.net/limodou
> NewEdit Maillist: http://groups.google.com/group/NewEdit
> 




More information about the Python-list mailing list