Retrieve edited list from TextEditMixin

After editing the ListCtrl, I’m able to see the results up to a point. Using the

wx.EVT_LIST_BEGIN and END _LABEL_EDIT method. I have a button that

refreshes EndLabelEdit. I works fine. However I cannot iterate the entire list

outside that function. I tryed to split, change to list … I need to able to transfer

these new lines to other events. All I get is the last row.

Forgive me, the question is harder that answer.

def BeginLabelEdit(self,event):
print “BeginLabelEdit”
self.mySelection = self.lc.GetItem(self.lc.GetFirstSelected()).GetText()
event.Skip()

def EndLabelEdit(self,event):
    print "EndLabelEdit"

for row in range(0,self.lc.GetItemCount()):
self.newlines = str(",".join([self.lc.GetItem(row, col).GetText() for col in range(self.lc.GetColumnCount())]))
print self.newlines

def updateListCtrl(self, event):
    self.EndLabelEdit(event)
    print '-------------------'       
    print self.newlines  ####  prints last line

Try this instead:
        self.newlines =
        for row in range(0,self.lc.GetItemCount()):
            self.newlines.append(str(",".join([self.lc.GetItem(row,
col).GetText() for col in range(self.lc.GetColumnCount())])))

···

On Fri, Nov 22, 2013 at 6:01 PM, George McCown <georgemccown@gmail.com>wrote:

After editing the ListCtrl, I'm able to see the results up to a point.
Using the
wx.EVT_LIST_BEGIN and END _LABEL_EDIT method. I have a button that
refreshes EndLabelEdit. I works fine. However I cannot iterate the
entire list
outside that function. I tryed to split, change to list ... I need to
able to transfer
these new lines to other events. All I get is the last row.

Forgive me, the question is harder that answer.

    def BeginLabelEdit(self,event):
        print "BeginLabelEdit"
        self.mySelection =
self.lc.GetItem(self.lc.GetFirstSelected()).GetText()
        event.Skip()

    def EndLabelEdit(self,event):
        print "EndLabelEdit"
        for row in range(0,self.lc.GetItemCount()):
            self.newlines = str(",".join([self.lc.GetItem(row,
col).GetText() for col in range(self.lc.GetColumnCount())]))
            print self.newlines

    def updateListCtrl(self, event):
        self.EndLabelEdit(event)
        print '-------------------'
        print self.newlines #### prints last line

--
Best Regards,
Michael Moriarity

That did it. Thanks Michael.

···

On Friday, November 22, 2013 6:57:54 PM UTC-6, Data...@gmail.com wrote:

On Fri, Nov 22, 2013 at 6:01 PM, George McCown george...@gmail.com wrote:

After editing the ListCtrl, I’m able to see the results up to a point. Using the

wx.EVT_LIST_BEGIN and END _LABEL_EDIT method. I have a button that

refreshes EndLabelEdit. I works fine. However I cannot iterate the entire list

outside that function. I tryed to split, change to list … I need to able to transfer

these new lines to other events. All I get is the last row.

Forgive me, the question is harder that answer.

def BeginLabelEdit(self,event):
print “BeginLabelEdit”

    self.mySelection = self.lc.GetItem(self.lc.GetFirstSelected()).GetText()
    event.Skip()
   
def EndLabelEdit(self,event):
    print "EndLabelEdit"

for row in range(0,self.lc.GetItemCount()):

        self.newlines = str(",".join([self.lc.GetItem(row, col).GetText() for col in range(self.lc.GetColumnCount())]))
        print self.newlines
def updateListCtrl(self, event):

    self.EndLabelEdit(event)
    print '-------------------'       
    print self.newlines  ####  prints last line

Try this instead:

self.newlines =

for row in range(0,self.lc.GetItemCount()):
self.newlines.append(str(“,”.join([self.lc.GetItem(row, col).GetText() for col in range(self.lc.GetColumnCount())])))

Best Regards,
Michael Moriarity