[wxPython] column alignment on wxListCtrl

Hi,

I'm trying to align some of the numerical values in my listctrl to the right,
but can't seem to get it to work. I've included the two extra parameters to
the insert column function but it just ignores them. Anyone have any ideas?

self.InsertColumn(column, headerlist[column], format=wxLIST_FORMAT_RIGHT,
width=-1)

I see that there might be a way to change the alignment per item, but I think
that would probably be cumbersome and slow. I thought I'd ask first.

Gracias in advance,
Mike

···

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

I'm trying to align some of the numerical values in my listctrl to the

right,

but can't seem to get it to work. I've included the two extra parameters

to

the insert column function but it just ignores them. Anyone have any

ideas?

self.InsertColumn(column, headerlist[column], format=wxLIST_FORMAT_RIGHT,
width=-1)

I see that there might be a way to change the alignment per item, but I

think

that would probably be cumbersome and slow. I thought I'd ask first.

I can get it to work for columns other than the first one, (at least on
wxMSW.) I'm not sure why the flag has no effect for the first column, the
C++ code seems to be doing the right thing according to MSDN.

For wxGTK it looks like the alignment flags aren't supported as I don't see
them being used anywhere in the layout code.

Please enter a bug report about this at
    http://sourceforge.net/bugs/?group_id=9863

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxPython.org Java give you jitters?
http://wxPROs.com Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

Hi,

I realize I am reviving an extremely old thread, but I am having the exact same problem: My first column in a list control does not right-align under Windows XP. I am a little confused because I found this bug report (apparently from four years ago?) which says it’s fixed. If that is so, how come I am still seeing the problem? And, more importantly, how can I change this?

Thanks,
Ingrid

  • Windows XP
  • Python 2.7.4
  • wxPython 2.8.12.1
···

Am Mittwoch, 27. September 2000 11:18:06 UTC-7 schrieb Robin Dunn:

I’m trying to align some of the numerical values in my listctrl to the
right,
but can’t seem to get it to work. I’ve included the two extra parameters
to
the insert column function but it just ignores them. Anyone have any
ideas?

self.InsertColumn(column, headerlist[column], format=wxLIST_FORMAT_RIGHT,
width=-1)

I see that there might be a way to change the alignment per item, but I
think
that would probably be cumbersome and slow. I thought I’d ask first.

I can get it to work for columns other than the first one, (at least on
wxMSW.) I’m not sure why the flag has no effect for the first column, the
C++ code seems to be doing the right thing according to MSDN.

For wxGTK it looks like the alignment flags aren’t supported as I don’t see
them being used anywhere in the layout code.

Please enter a bug report about this at
http://sourceforge.net/bugs/?group_id=9863


Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxPython.org Java give you jitters?
http://wxPROs.com Relax with wxPython!


wxPython-users mailing list
wxPytho...@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

That bug reports relates to wxDataViewListCtrl which I don’t think
exists in wxPython 2.8.
I just tried it with wx.ListCtrl in wxPython 3.0 and I can’t get
column 0 to right align either, maybe a limitation of the native
listctrl as even Robin could not get it to work.
The wxDataViewListCtrl does allow right aligning of column 0, just
tried it with wxPython 3.0, so if you can upgrade to wxPyhton 2.9.5
or 3.0 you could use that instead.
Werner

···

Hi Ingrid,

  On 4/9/2014 9:42, Ingrid wrote:

Hi,

    I realize I am reviving an extremely old thread, but I am having

the exact same problem: My first column in a list control does
not right-align under Windows XP. I am a little confused
because I found this bug report
(apparently from four years ago?) which says it’s fixed. If
that is so, how come I am still seeing the problem? And, more
importantly, how can I change this?

Thanks for your answer, Werner! Seems like I confused the two types of list controls - actually, I hadn’t heard of the DataViewListCtrl before. I will look into it, but since I have already written a fairly extensive search dialog for my list control and like the column sorter mixin for it, I will most likely stick with the list control. People will just have to live with a left-aligned first column in my application, I guess…

Thanks for your help!

Ingrid

···

Am Mittwoch, 9. April 2014 02:16:58 UTC-7 schrieb werner:

Hi Ingrid,

  On 4/9/2014 9:42, Ingrid wrote:

Hi,

    I realize I am reviving an extremely old thread, but I am having

the exact same problem: My first column in a list control does
not right-align under Windows XP. I am a little confused
because I found this bug report
(apparently from four years ago?) which says it’s fixed. If
that is so, how come I am still seeing the problem? And, more
importantly, how can I change this?

That bug reports relates to wxDataViewListCtrl which I don't think

exists in wxPython 2.8.

I just tried it with wx.ListCtrl in wxPython 3.0 and I can't get

column 0 to right align either, maybe a limitation of the native
listctrl as even Robin could not get it to work.

The wxDataViewListCtrl does allow right aligning of column 0, just

tried it with wxPython 3.0, so if you can upgrade to wxPyhton 2.9.5
or 3.0 you could use that instead.

Werner