Skip to content

Commit c943303

Browse files
committed
docs: describe gotcha with ScrollBox and HBar/VBar
1 parent 850f537 commit c943303

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

docs/more_useful_widgets.rst

+15-5
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,24 @@ configured with a different inner class:
193193
expand vertically. This requires that its alignment be ``'fill'`` and
194194
that it uses `Background` (either directly or via `Button`).
195195

196+
.. note::
197+
198+
If no ``VBar`` inner class is specified, the scroll box will not be
199+
scrollable in the vertical direction. Likewise for ``HBar`` and horizontal
200+
scrolling. Therefore, a class that inherits from ``ScrollBox`` but that
201+
doesn't implement either ``HBar`` or ``VBar`` will not actually be
202+
scrollable. This is an easy mistake to make.
203+
204+
.. note::
205+
206+
If you want to have both vertical and horizontal scroll bars: put all your
207+
customizations in a common class that doesn't inherit from any widget, then
208+
use multiple inheritance to derive ``HBar`` and ``VBar`` classes that
209+
derive from both the common class and either `HScrollBar` or `VScrollBar`.
210+
196211
- ``HBar``: This inner class is responsible for the horizontal scroll bar.
197212
It's pretty much identical to ``VBar``, but it inherits from `HScrollBar`.
198213

199-
If you want to have both vertical and horizontal scroll bars: put all your
200-
customizations in a common class that doesn't inherit from any widget, then
201-
use multiple inheritance to derive ``HBar`` and ``VBar`` classes that derive
202-
from both the common class and either `HScrollBar` or `VScrollBar`.
203-
204214
- ``Corner``: This inner class fills in the space created by the two scroll
205215
bars in the bottom right corner of the scroll box. It typically inherits
206216
from `Image`, and it will only be displayed if there are two scroll bars.

0 commit comments

Comments
 (0)