I have a simple custom ListCtrl to implement drawing common lists in my app. It
uses wx.LIST_AUTOSIZE_USEHEADER by default to set up the column widths every
time the list is updated. For some reason, when the list is updated, the first
column width will never get set wide enough for the data contained in it. All
the other columns seem to update OK. Also, if I change the first column header
to a longer string, the auto-width calculation seems to work. The app is pasted
below. Can anyone tell me what I'm doing wrong? Is this something that the new
ColumnSizerMixin is supposed to address?
Assuming you are on Windows then I suspect that this is just another example of MS's weirdness about the native ListView. There are some other examples of things working differently with the first column than the others. For example, you can't right or center justify the column label text, if there is an image list then room is reserved in the first column for the images even if you don't use them for the items, etc.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
So THAT’s the cause of all that foolishment! In one of my projects I beat my head against the first-column justification thing for a few hours, and moved on 'cause I had bigger fish to fry - but it’s nice to know it wasn’t something I was doing wrong!
···
On Mon, Mar 17, 2008 at 5:54 PM, Robin Dunn robin@alldunn.com wrote:
Assuming you are on Windows then I suspect that this is just another
example of MS’s weirdness about the native ListView. There are some
other examples of things working differently with the first column than
the others. For example, you can’t right or center justify the column
label text, if there is an image list then room is reserved in the first
column for the images even if you don’t use them for the items, etc.
Yes, this problem is occurring on Windows. The auto-chosen column widths seem to
be < 5 pixels too small in most cases I've seen, so it might be fixable by
adding a SetColumnWidth(GetColumnWidth(column_num)+some_small_constant) after
all is said and done. But obviously that isn't a very nice solution. For now, I
can work around this silliness by just choosing a larger column title string...
Let me know if anyone has a better solution.
Thanks,
Tim