[ObjectListView] get info about sorting

69 views
Skip to first unread message

moo...@posteo.org

unread,
Feb 27, 2015, 10:24:45 PM2/27/15
to wxpytho...@googlegroups.com
I want to ask a ObjectListView object if and which of its columns
(index would be enough) are sorted and in which direction (asc or desc).

I know
ObjectListView.GetSortColumn()
which return a ColumnDef object.

But I can see now way how to ask about the index of the ColumnDef.

In wx.ListCtrl I can not found anything about sorting.

Werner

unread,
Feb 28, 2015, 6:28:16 AM2/28/15
to wxpytho...@googlegroups.com
On 2/28/2015 4:24, moo...@posteo.org wrote:
> I want to ask a ObjectListView object if and which of its columns
> (index would be enough) are sorted and in which direction (asc or desc).
I am not aware of a way to get at the column index and the sort direction.

What use case do you have that you need that?
>
> I know
> ObjectListView.GetSortColumn()
> which return a ColumnDef object.
Why is the ColumnDef not good enough?
>
> But I can see now way how to ask about the index of the ColumnDef.
>
> In wx.ListCtrl I can not found anything about sorting.
There is a ColumnSorterMixin:
http://wxpython.org/Phoenix/docs/html/lib.mixins.listctrl.ColumnSorterMixin.html#lib-mixins-listctrl-columnsortermixin

Did you see the dataview stuff:
http://wxpython.org/Phoenix/docs/html/dataview.1classindex.html

Werner

Yoriz

unread,
Feb 28, 2015, 3:25:43 PM2/28/15
to wxpytho...@googlegroups.com, moo...@posteo.org

ObjectListView has attributes sortColumnIndex and sortAscending.

moo...@posteo.org

unread,
Feb 28, 2015, 4:21:44 PM2/28/15
to wxpytho...@googlegroups.com
On 2015-02-28 12:28 Werner <wern...@gmx.ch> wrote:
> What use case do you have that you need that?

I like my applications to remember "gui metrics" (window size,
position, in list-ctrls column widht, ordering, etc).

I push this really far:
My app run on different machines with different displays.
So it stores all this informations for each display size separate. ;)

Werner

unread,
Mar 1, 2015, 6:18:56 AM3/1/15
to wxpytho...@googlegroups.com

moo...@posteo.org

unread,
Mar 1, 2015, 8:25:21 AM3/1/15
to wxpytho...@googlegroups.com
On 2015-03-01 12:18 Werner <wern...@gmx.ch> wrote:
> Are you aware of wx.lib.agw.persist -

Mhm... Sounds ok but maybe to much.

What about ObjectListView? I need to implement a handler for it.
What is really stored for the wx-classes? What is the meaning of
"properties of the windows"?
To much questions. To intransparent.

And I think it can not handle different display sizes out-of-the-box.
I would need to implement this my self (maybe different config-files
for each display-size).

I prefer to get the control for myself. ;)

And my solution is (in the future *fg*) generic and portable between
all gui-libs.
Reply all
Reply to author
Forward
0 new messages