How to determine scroll bar width/height for grids

I just installed the wxPython app I built on my Mac onto a Windows 10 system. Functionally, everything is fine but I noticed that the grid controls were a bit, er, wonky. My assumption is that underlying native controls may be involved, but columns that were displaying just fine on the Mac were too wide on the Windows system. So I have a question about the wx.Grid.grid control so that I can come up with a better understanding of how to bridge this particular gap between the different operating systems.

Let’s use the following diagram for my question:

I’m assuming that I have things properly labeled, but I’m quite open to corrections.

Questions

  1. is the V. Scrollbar in the same client area as the actual grid or are the grid and the scrollbar in the same client area? (the latter appears to be the case but I want to be sure that I have a correct understanding.)
  2. I assume that if the scrollbar is in the same client area and if that assumption is correct, how can I determine the width of the scrollbar so that I can adjust the column sizes to accommodate it? (for my application, the overall grid control size is fixed width and the vertical scroll bar will always be present).

Thanks in advance for your responses!

It varies a little by platform, but you can think of it as the scrollbars are children of the grid window. (On Mac they are actually wxScrollBars, on the other platforms they are a built-in feature of the native window.)

You can get the default width for the scrollbars from the wx.SystemSettings.GetMetric static method. The metric ID you’re interested in is wx.SYS_VSCROLL_X. IIRC, it may be a pixel or two off depending on how the grid window is calculating its own layout.