summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2009-02-20 08:15:32 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2009-02-20 08:15:32 +0000
commit354701c6f6ab5facf477c47c4bf69ed0bcc55c1d (patch)
tree8804118cfa5fc674cc2fa7e5aeabb6cbd49817ff /FL
parent5e9a5f30236248babbaca26b241467c5d3211423 (diff)
Documentation updates for STR #2142 (protected draw methods).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6665 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Widget.H11
1 files changed, 10 insertions, 1 deletions
diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H
index 46e457833..8d6e57005 100644
--- a/FL/Fl_Widget.H
+++ b/FL/Fl_Widget.H
@@ -177,8 +177,17 @@ public:
Never call this function directly. FLTK will schedule redrawing whenever
needed. If your widget must be redrawn as soon as possible, call redraw()
instead.
-
+
Override this function to draw your own widgets.
+
+ If you ever need to call another widget's draw method <I>from within your
+ own draw method</I>, e.g. for an embedded scrollbar, you must downcast the
+ embedded widget's pointer to Fl_Widget* and call the virtual draw() method.
+
+ \code
+ Fl_Widget *s = &scroll; // scroll is an embedded Fl_Scrollbar
+ s->draw(); // calls Fl_Scrollbar::draw()
+ \endcode
*/
virtual void draw() = 0;