Well, I've spent a couple of hours piecing through the doc and
experimenting with the demo programs, and I'm stumped.
I have a ListCtrl (Report mode) with three columns, and I'd like the user
to be able to edit any of the "cells" in this. In the callback for
EVT_LIST_ITEM_SELECTED I can call the EditLabel() method on the ListCtrl,
passing it event.m_itemIndex. This allows editing of the first (0-th)
column for the selected item. But how do I edit the other columns?
EditLabel() seems to take only an item index parameter instead of a
wxListItem. And I can't even seem to get the column that is clicked in.
No matter what I do in attempting to extract column information from the
event, m_col seems to be 0.
And if I could get it, how could I use it to make that "cell" editable?
Are labels editable only in column 0?
···
--------------------------------------
Gary H. Merrill
Director and Principal Scientist, New Applications
Data Exploration Sciences
GlaxoSmithKline Inc.
(919) 483-8456
Hey gary,
Labels are just another name for the string in the first column as far
as I understand it, you use them when you insert the item but after that
you need to set the string with SetStringItem.
Something like this:
#first you have to insert the item
Self.listy.InsertStringItem(index, 'label')
#then set string for other columns
self.listy.SetStringItem(index, [column number], 'sample string')
Hope this helps
Sam
···
-----Original Message-----
From: gary.h.merrill@gsk.com [mailto:gary.h.merrill@gsk.com]
Sent: Monday, May 12, 2003 10:31 AM
To: wxPython-users@lists.wxwindows.org
Subject: [wxPython-users] Column pos and editing ListCtrl items
Well, I've spent a couple of hours piecing through the doc and
experimenting with the demo programs, and I'm stumped.
I have a ListCtrl (Report mode) with three columns, and I'd like the
user to be able to edit any of the "cells" in this. In the callback for
EVT_LIST_ITEM_SELECTED I can call the EditLabel() method on the
ListCtrl, passing it event.m_itemIndex. This allows editing of the
first (0-th) column for the selected item. But how do I edit the other
columns?
EditLabel() seems to take only an item index parameter instead of a
wxListItem. And I can't even seem to get the column that is clicked in.
No matter what I do in attempting to extract column information from the
event, m_col seems to be 0.
And if I could get it, how could I use it to make that "cell" editable?
Are labels editable only in column 0?
--------------------------------------
Gary H. Merrill
Director and Principal Scientist, New Applications
Data Exploration Sciences
GlaxoSmithKline Inc.
(919) 483-8456
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org