How do I get the dimensions of the view (not obstructed by scrollbars) in a wx.ScrolledWindow?

How do I get the dimensions of the view (not obstructed by scrollbars) in a wx.ScrolledWindow?

网名女生简单气质 发布于 2021-11-29 字数 185 浏览 836 回复 1 原文

Is there an easy way to do this? Alternatively, if I could get the width of the scrollbars, I could just use the dimensions of the ScrolledWindow and subtract them out myself...

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

枕花眠 2022-06-07 1 楼

Use wx.SystemSettings.GetMetric() with wx.SYS_HSCROLL_Y and wx.SYS_VSCROLL_X to get the scrollbar sizes. Then use window.GetClientSize() and subtract it out.

http://docs.wxwidgets.org/stable/wx_wxsystemsettings.html

>>> wx.SystemSettings.GetMetric(wx.SYS_HSCROLL_Y)
16
>>> wx.SystemSettings.GetMetric(wx.SYS_VSCROLL_X)
16