From 354701c6f6ab5facf477c47c4bf69ed0bcc55c1d Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Fri, 20 Feb 2009 08:15:32 +0000 Subject: 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 --- FL/Fl_Widget.H | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'FL') 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 from within your + own draw method, 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; -- cgit v1.2.3