Re: [wxpython-users] Column widths in ListCtrl
by Andrea Gavana other posts by this author
May 8 2008 6:30AM messages near this date
[wxpython-users] Column widths in ListCtrl
|
Re: [wxpython-users] Column widths in ListCtrl
Hi Jacek,
On Thu, May 8, 2008 at 2:10 PM, Jacek Poplawski wrote:
> How to autosize columns in ListCtrl?
wx.ListCtrl has a couple of ways to do that: from the wxWidgets docs:
wxListCtrl::SetColumnWidth
bool SetColumnWidth(int col, int width)
Sets the column width.
width can be a width in pixels or wxLIST_AUTOSIZE (-1) or
wxLIST_AUTOSIZE_USEHEADER (-2). wxLIST_AUTOSIZE will resize the column
to the length of its longest item. wxLIST_AUTOSIZE_USEHEADER will
resize the column to the length of the header (Win32) or 80 pixels
(other platforms).
So, depending on your need, just use wx.LIST_AUTOSIZE or
wx.LIST_AUTOSIZE_USEHEADER to autosize your columns. See also the
ListCtrlAutoWidthMixin wx.lib.mixins.listctrl and the wxPython demo on
wx.ListCtrl on how to use it.
HTH.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
_______________________________________________
wxpython-users mailing list
wxpython-users@[...].org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Thread:
Jacek Poplawski
Andrea Gavana
Jacek Poplawski
Andrea Gavana
Chester
|