[wxPython-users] Autosizing grid's last column
Robin Dunn
robin at alldunn.com
Thu Feb 8 11:51:42 PST 2007
Eli Golovinsky wrote:
> I'm trying to resize the rightmost column of the grid to fill the window
> it's in, like what ListCtrlAutoWidthMixin does to a list control.
>
> For some reason it doesn't seem to be working cleanly. When you play
> around with the size of the frame in the attached example, the
> horizontal scrollbar appears for no apparent reason.
>
> Am I missing something in my calculations? Something else?
wx.ScrolledWindow uses a scroll unit value which is the number of pixels
the window will be scrolled with each step, (a.k.a. the scroll rate.)
Because of this the virtual size of the window will always be a multiple
of this unit size. So if the size needed by the grid is not an exact
multiple of the unit size then it will actually tell the scrollbars that
it needs something like width + rate - (width % rate) pixels. To size
the columns such that no scrollbar appears then it needs to be the
multiple of the scroll rate that is <= width.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list