wxListCtrl Help

WX : 2.8.9.1

OS : Windows XP

COMPILER: IDLE 2.6.1

To whom this may concern,

I am trying to access and
edit selected items in a ListCtrl. Ideally I want to be able to double click it
and edit the cell. I’ve looked around and been unable to find a function
in wxPython that works. There is GetSelected() but I’m having trouble
using it.

Hello,

···

On Mon, Mar 2, 2009 at 1:59 PM, Paster, Samuel J (MS) Samuel.Paster@ngc.com wrote:

I am trying to access and edit selected items in a ListCtrl. Ideally I want to be able to double click it and edit the cell. I’ve looked around and been unable to find a function in wxPython that works. There is GetSelected() but I’m having trouble using it.

If you haven’t already, download the wxPython demo (same place you downloaded wxpython from), and see the ListCtrl_edit sample for a full example of using an editable ListCtrl.

Cody

Have a look at ObjectListView (http://objectlistview.sourceforge.net/python).

It will ease your pain :slight_smile:

Regards,

Phillip

···

2009/3/2 Cody Precord codyprecord@gmail.com

Hello,

On Mon, Mar 2, 2009 at 1:59 PM, Paster, Samuel J (MS) Samuel.Paster@ngc.com wrote:

I am trying to access and edit selected items in a ListCtrl. Ideally I want to be able to double click it and edit the cell. I’ve looked around and been unable to find a function in wxPython that works. There is GetSelected() but I’m having trouble using it.

If you haven’t already, download the wxPython demo (same place you downloaded wxpython from), and see the ListCtrl_edit sample for a full example of using an editable ListCtrl.

Cody


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Phillip Piper www.bigfoot.com/~phillip_piper phillip_piper@bigfoot.com

A man’s life does not consist in the abundance of his possessions

Hi,

···

From: Paster, Samuel J (MS) [mailto:Samuel.Paster@ngc.com]
Sent: Monday, March 02, 2009 21:59
To: wxpython-users@lists.wxwidgets.org
Subject:
[wxpython-users] wxListCtrl Help

WX : 2.8.9.1

OS : Windows XP

COMPILER: IDLE 2.6.1

To whom this may concern,

I am trying to access and edit selected items in a ListCtrl. Ideally I want to be able to double click it and edit the cell. I’ve looked around and been unable to find a function in wxPython that works. There is GetSelected() but I’m having trouble using it.

I use the following snippet when I want to get lines from a ListCtrl:

      first_selected = self.list_ctrl.GetFirstSelected()
      text_for_clipboard = ""
      text_for_clipboard = "%s%s\n" % (text_for_clipboard, self.list_ctrl.GetItemText(first_selected))
      next_selcted_index = self.list_ctrl.GetNextSelected(first_selected)
      while next_selcted_index > -1:
          text_for_clipboard = "%s%s\n" % (text_for_clipboard, self.list_ctrl.GetItemText(next_selcted_index))
          next_selcted_index = self.list_ctrl.GetNextSelected(next_selcted_index)

Bye,

Ron.