ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> wxpython-users
wxpython-users
Re: [wxpython-users] wx.ListCtrl(), Report Mode, Editing Columns
by Robin Dunn other posts by this author
May 9 2008 10:03AM messages near this date
[wxpython-users] wx.ListCtrl(), Report Mode, Editing Columns | Re: [wxpython-users] wx.ListCtrl(), Report Mode, Editing Columns
Rich Shepard wrote:
>    Testing the item editing function for my 5-column list in report mode
>  throws error for which I have not found a solution in the wPIA book. In
>  subsection 13.4.1 (page 411) I learn, "[e]diting an entry in the list is
>  simple, except in report lists, where the user can only edit the first
>  column in each row." Sigh.
>  
>    The approach I tried is in this function (only the first part which
>  generates the error is reproduced; I'll deal with the rest when I get
>  there):
>  
>      def OnRuleEdit(self, event):
>            # copy contents of row for each column to variables
>            row = self.itemID
>            idx = self.rulesList.GetFirstSelected()
>            pName = self.rulesList.GetItem(row, 0).GetText()
>            sName = self.rulesList.GetItem(row, 1).GetText()
>            vName = self.rulesList.GetItem(row, 2).GetText()
>            rNo = self.rulesList.GetItem(row, 3).GetText()
>            rTxt = self.rulesList.GetItem(row, 4).GetText()
>  
>    The python error is:
>  
>  Traceback (most recent call last):
>    File "/data1/eikos/rulePage.py", line 112, in OnRuleEdit
>      pName = self.rulesList.GetItem(row, 0).GetText()
>    File
>  "/usr/lib/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/_controls.py", 
>  line
>  4503, in GetItem
>      val = _controls_.ListCtrl_GetItem(*args, **kwargs)
>  TypeError: in method 'ListCtrl_GetItem', expected argument 2 of type 'long'

What is type(row)?  Remember that argument 1 is the implicit self 
parameter, so the error above is actually about the row parameter.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!

_______________________________________________
wxpython-users mailing list
wxpython-users@[...].org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Thread:
Rich Shepard
Robin Dunn
Mike Driscoll
Rich Shepard
Rich Shepard
Robin Dunn
Rich Shepard
Robin Dunn
C M
C M
Mike Driscoll
Rich Shepard
Rich Shepard
Robin Dunn
Rich Shepard

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved