summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2021-12-08 14:22:40 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2021-12-08 14:22:40 +0100
commiteb7fb00801eb917ca1350d36ea896446cf4e5fb8 (patch)
treeb17899dbebdf35ed345cf1d7761c78159606aefc
parent4bc25f7f9df2872189d57c21f1fa937d83b71536 (diff)
Improve Fl_Scroll docs regarding its bounding box
Make clear that outside labels of widgets are not considered when calculating the bounding box of the children (scroll area) and include a hint to add an invisible box if necessary.
-rw-r--r--FL/Fl_Scroll.H13
1 files changed, 13 insertions, 0 deletions
diff --git a/FL/Fl_Scroll.H b/FL/Fl_Scroll.H
index ce2ff14f9..75f5c6b44 100644
--- a/FL/Fl_Scroll.H
+++ b/FL/Fl_Scroll.H
@@ -39,6 +39,19 @@
blinking during redrawing, but that can be solved by using a
Fl_Double_Window.
+ The Fl_Scroll widget calculates the bounding box of all its children
+ by using their widget positions and sizes (x, y, w, h). Outside labels
+ are not considered. If you need outside labels of any widgets or free
+ space outside of this bounding box you can add a tiny invisible Fl_Box
+ at the relevant corner(s) of the Fl_Scroll widget, for instance:
+ \code
+ Fl_Scroll scroll(100, 100, 200, 200); // Fl_Scroll at (100, 100)
+ Fl_Box(100, 100, 1, 1); // Fl_Box in top left corner
+ Fl_Input(150, 120, 60, 30, "Input:"); // left most widget with label
+ // ... more widgets ...
+ scroll.end();
+ \endcode
+
By default you can scroll in both directions, and the scrollbars
disappear if the data will fit in the area of the scroll.