What I mean is ListCtrl has InsertStringItem but ListBox has Append. These have the same goal, to get some text into a list of one type or another. (I actually was pretty confused as to why the ListCtrl doesn’t simply have a single-column mode, which is essentially what ListBox is)
Also, ListCtrl doesn’t subclass ItemContainer… but why not? This means you can’t associate data in a similar fashion to ListBox… so it seems the API/implementation is all disjoint/all over the place.
A ListCtrl is a vastly different widget than a ListBox. ListCtrl’s are multi-column and multi-cell. You can edit cells in place. You cannot do that in a ListBox. The ListCtrl also has several different modes that will radically change its appearance. I think the ListCtrl is closer to the wx.Grid than to a ListBox.
If you want to associate data, then I would use the ObjectListView widget, which is a wrapper around the wx.ListCtrl.
···
On Thursday, May 15, 2014 1:04:07 PM UTC-5, Nathan McCorkle wrote:
What I mean is ListCtrl has InsertStringItem but ListBox has Append. These have the same goal, to get some text into a list of one type or another. (I actually was pretty confused as to why the ListCtrl doesn’t simply have a single-column mode, which is essentially what ListBox is)
Also, ListCtrl doesn’t subclass ItemContainer… but why not? This means you can’t associate data in a similar fashion to ListBox… so it seems the API/implementation is all disjoint/all over the place.
But why is the API inconsistent? It’s still just a list of rows, most people will want to add/remove/and insert… so why not have those functions named consistently?
···
On Thursday, May 15, 2014 11:34:02 AM UTC-7, Mike Driscoll wrote:
On Thursday, May 15, 2014 1:04:07 PM UTC-5, Nathan McCorkle wrote:
What I mean is ListCtrl has InsertStringItem but ListBox has Append. These have the same goal, to get some text into a list of one type or another. (I actually was pretty confused as to why the ListCtrl doesn’t simply have a single-column mode, which is essentially what ListBox is)
Also, ListCtrl doesn’t subclass ItemContainer… but why not? This means you can’t associate data in a similar fashion to ListBox… so it seems the API/implementation is all disjoint/all over the place.
A ListCtrl is a vastly different widget than a ListBox. ListCtrl’s are multi-column and multi-cell. You can edit cells in place. You cannot do that in a ListBox. The ListCtrl also has several different modes that will radically change its appearance. I think the ListCtrl is closer to the wx.Grid than to a ListBox.
If you want to associate data, then I would use the ObjectListView widget, which is a wrapper around the wx.ListCtrl.
Don’t know why it was/is that way, but some of these things are
corrected in Phoenix, at least some of the comments you make below
are, see:
wxpython.org/Phoenix/docs/html/ListBox.html
e.g. ListBox is inheriting/subclassing from ItemContainer.
Some of the Phoenix doc/info might be of interest.
Werner
···
Hi Nathan,
On 5/20/2014 19:56, Nathan McCorkle wrote:
But why is the API inconsistent? It's still just a
list of rows, most people will want to add/remove/and insert…
so why not have those functions named consistently?
http://wiki.wxpython.org/ProjectPhoenix/ProjectGoals
On Thursday, May 15, 2014 11:34:02 AM UTC-7, Mike Driscoll
wrote:
On Thursday, May 15, 2014 1:04:07 PM UTC-5, Nathan McCorkle
wrote:
What I mean is ListCtrl has
InsertStringItem but ListBox has Append. These have the
same goal, to get some text into a list of one type or
another. (I actually was pretty confused as to why the
ListCtrl doesn’t simply have a single-column mode, which
is essentially what ListBox is)
Also, ListCtrl doesn't subclass ItemContainer...
but why not? This means you can’t associate data in a
similar fashion to ListBox… so it seems the
API/implementation is all disjoint/all over the place.
A ListCtrl is a vastly different widget than a ListBox.
ListCtrl’s are multi-column and multi-cell. You can edit
cells in place. You cannot do that in a ListBox. The
ListCtrl also has several different modes that will
radically change its appearance. I think the ListCtrl is
closer to the wx.Grid than to a ListBox.
If you want to associate data, then I would use the
ObjectListView widget, which is a wrapper around the
wx.ListCtrl.
- Mike
–
You received this message because you are subscribed to the Google
Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it,
send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
Actually ListBox previously inherited from ItemContainer, and still does… ListCtrl didn’t, and still doesn’t 
I also don’t see anything about standardizing on Add /or/ Append /or/ Set (or with suffixes SetStringItem, etc…) over here:
http://wxpython.org/Phoenix/docs/html/classic_vs_phoenix.html
···
On Wednesday, May 21, 2014 2:30:12 AM UTC-7, werner wrote:
Hi Nathan,
On 5/20/2014 19:56, Nathan McCorkle wrote:
But why is the API inconsistent? It's still just a
list of rows, most people will want to add/remove/and insert…
so why not have those functions named consistently?
Don't know why it was/is that way, but some of these things are
corrected in Phoenix, at least some of the comments you make below
are, see:
[wxpython.org/Phoenix/docs/html/ListBox.html](http://wxpython.org/Phoenix/docs/html/ListBox.html)
e.g. ListBox is inheriting/subclassing from ItemContainer.
Some of the Phoenix doc/info might be of interest.
[http://wiki.wxpython.org/ProjectPhoenix/ProjectGoals](http://wiki.wxpython.org/ProjectPhoenix/ProjectGoals)
Werner
On Thursday, May 15, 2014 11:34:02 AM UTC-7, Mike Driscoll > > wrote:
On Thursday, May 15, 2014 1:04:07 PM UTC-5, Nathan McCorkle > > > wrote:
What I mean is ListCtrl has
InsertStringItem but ListBox has Append. These have the
same goal, to get some text into a list of one type or
another. (I actually was pretty confused as to why the
ListCtrl doesn’t simply have a single-column mode, which
is essentially what ListBox is)
Also, ListCtrl doesn't subclass ItemContainer...
but why not? This means you can’t associate data in a
similar fashion to ListBox… so it seems the
API/implementation is all disjoint/all over the place.
A ListCtrl is a vastly different widget than a ListBox.
ListCtrl’s are multi-column and multi-cell. You can edit
cells in place. You cannot do that in a ListBox. The
ListCtrl also has several different modes that will
radically change its appearance. I think the ListCtrl is
closer to the wx.Grid than to a ListBox.
If you want to associate data, then I would use the
ObjectListView widget, which is a wrapper around the
wx.ListCtrl.
- Mike
–
You received this message because you are subscribed to the Google
Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it,
send an email to wxpython-user...@googlegroups.com.
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
(which appears to be why you can’t SetObjectData or GetObjectData with a ListCtrl)
···
On Thursday, May 22, 2014 11:25:15 AM UTC-7, Nathan McCorkle wrote:
Actually ListBox previously inherited from ItemContainer, and still does… ListCtrl didn’t, and still doesn’t 
oops, should read the posts better
Do you mean Set/GetClientData in ItemContainer? If yes, I think
Set/GetItemData in the ListCtrl allows you to do this.
I think these differences in API come from wxWidgets and might be
due to the underlying widget.
Phoenix does a lot of clean up but I don’t think it goes and renames
methods, it still uses what ‘comes’ from wxWidgets.
Phoenix has nicer handling of the ‘overloaded’ methods.
You might also want to look at the dataview classes, e.g.
DataViewListCtrl, if you haven’t already done so.
Werner
···
Hi Nathan,
On 5/22/2014 20:26, Nathan McCorkle wrote:
On Thursday, May 22, 2014 11:25:15 AM UTC-7, Nathan McCorkle
wrote:
Actually ListBox previously inherited from
ItemContainer, and still does… ListCtrl didn’t, and still
doesn’t 
:-[
(which appears to be why you can't SetObjectData or
GetObjectData with a ListCtrl)
http://wxpython.org/Phoenix/docs/html/MigrationGuide.html
http://wxpython.org/Phoenix/docs/html/dataview.DataViewListCtrl.html#dataview-dataviewlistctrl