From: Simon Arrowsmith
> From: Robin Dunn [mailto:robin@alldunn.com]
> Simon Arrowsmith wrote:
> > How is LIST_AUTOSIZE supposed to work? I've got a two-column
> > LC_REPORT control where I want the first column to be some
> > size and the second column to fill the remaining width of the
> > control, with the data being added at some point after the
> > list has been initially drawn. Using the AutoWidthMixin and
> > self.SetColumnWidth(1, wxLIST_AUTOSIZE) does exactly the right
> > thing in 2.4 (MSW and GTK1.2). With 2.5 (GTK1.2 and GTK2) the
> > second column has an initial width of about 20, then snaps to
> > fill the remaining width if you manually expand it, if it has
> > any content (if it doesn't, it just adjusts to whatever width
> > you set). What's going on here?
> Sounds like maybe a missing Refresh(). Does calling it after
> SetColumnWidth help?
No. And a liberal scattering of Refresh()s in other places
(particular immediately after the contents of the list have been
changed) makes no difference either. Which is odd, because the
simplified version I've cooked up which shows similar behaviour
*does* sort itself out on calling Refresh() on the list.
And it appears that this isn't a platform dependency either --
I've just installed 2.5.3 for OS X and that's doing exactly the
same thing. And I don't have the time to narrow the problem down
(I've got my hands full maintaining the release version of the
software, which is using 2.4.2 quite happily, to do much work on
migrating to 2.5) at the moment 8-(
From: Robin Dunn [mailto:robin@alldunn.com]
Simon Arrowsmith wrote:
How is LIST_AUTOSIZE supposed to work? I've got a two-column
LC_REPORT control where I want the first column to be some
size and the second column to fill the remaining width of the
control, with the data being added at some point after the
list has been initially drawn. Using the AutoWidthMixin and
self.SetColumnWidth(1, wxLIST_AUTOSIZE) does exactly the right
thing in 2.4 (MSW and GTK1.2). With 2.5 (GTK1.2 and GTK2) the
second column has an initial width of about 20, then snaps to
fill the remaining width if you manually expand it, if it has
any content (if it doesn't, it just adjusts to whatever width
you set). What's going on here?
Sounds like maybe a missing Refresh(). Does calling it after SetColumnWidth help?
No. And a liberal scattering of Refresh()s in other places
(particular immediately after the contents of the list have been
changed) makes no difference either. Which is odd, because the
simplified version I've cooked up which shows similar behaviour
*does* sort itself out on calling Refresh() on the list.
And it appears that this isn't a platform dependency either --
I've just installed 2.5.3 for OS X and that's doing exactly the
same thing.
They both use the same generic ListCtrl class.
And I don't have the time to narrow the problem down
(I've got my hands full maintaining the release version of the
software, which is using 2.4.2 quite happily, to do much work on
migrating to 2.5) at the moment 8-(
If you can create a small sample app that shows the problem we can take a closer look at the problem.
ยทยทยท
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!