[wxPython-users] wxGrid and Scrollbars

Robin Dunn robin at alldunn.com
Tue Feb 5 14:54:50 PST 2008


Mark Erbaugh wrote:
> I have a grid that uses a grid table to manage the data. When creating
> the grid, I specify a size of (-1, height) where height is the desired
> height. My desire is to have the grid display just wide enough to
> include all the columns with no horizontal scrollbar. However, if the
> grid needs a vertical scrollbar (because there are too many rows to
> display in the given height), the width of the vertical scrollbar is not
> included in the grid width, so the grid displays with a horizontal
> scrollbar.
> 
> Is there a way to have the 'automatic'(i.e. -1) width of the grid
> include the width of the vertical scrollbar?

No, but you can probably tweak it yourself.  You can find the width of 
the scrollbar using wx.SystemSettings.GetMetric.


> 
> Is there a way to force the grid to always display a vertical scrollbar,
> whether it is actually needed?

No.  Not unless you want to give the grid enough empty rows that it 
needs a scrollbar to show them all.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list