0

Here is my column definition:

self.results_list.SetColumns([
    ColumnDefn('Street name', 'left', valueGetter='streetname',
               minimumWidth=150),
    ColumnDefn('House number', 'left', valueGetter='housenumber',
               minimumWidth=100),
    ColumnDefn('Letter', 'left', valueGetter='letter',
               minimumWidth=75),
    ColumnDefn('Postal code', 'right', valueGetter='postalcode',
               minimumWidth=120),
    ColumnDefn('City', 'left', valueGetter='city', minimumWidth=100,
               isSpaceFilling=True),
])

On OSX it looks great:

OSX

But on Windows...

Windows

How can I get the minimumWidth to apply even though there's no data in the ObjectListView?


I'm using Windows 8 and wxPython 2.9

1
  • That has always worked for me on Windows 7 and below. I'd ask on the wxPython user's group though. Maybe someone on there has Windows 8. Nov 13, 2012 at 15:30

1 Answer 1

1

For the third option in the ColumnDefn I added a -1 and the columns were adjusted to the minimum width that you specified when there is no data in the ObjectListView on Windows.

self.results_list.SetColumns([
ColumnDefn('Street name', 'left', -1, valueGetter='streetname',
           minimumWidth=150),
ColumnDefn('House number', 'left', -1, valueGetter='housenumber',
           minimumWidth=100),
ColumnDefn('Letter', 'left', -1, valueGetter='letter',
           minimumWidth=75),
ColumnDefn('Postal code', 'right', -1, valueGetter='postalcode',
           minimumWidth=120),
ColumnDefn('City', 'left', -1, valueGetter='city', minimumWidth=100,
           isSpaceFilling=True),])
2
  • That had absolutely no effect. Which version of Windows are you using? (I'm on Windows 8 with wxPython 2.9)
    – Hubro
    Nov 13, 2012 at 13:29
  • I am using Windows 7 with wxPython 2.8 Nov 15, 2012 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.