From aa88761194fd54f89d66ddf8fd90865d7ebae805 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 15 Jun 2003 04:41:16 +0000 Subject: Add clear() method to Fl_Scroll so that the scrollbars don't get deleted. (STR #75) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3032 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Scroll.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Fl_Scroll.cxx b/src/Fl_Scroll.cxx index 6cfdfc98e..7d09eb8ae 100644 --- a/src/Fl_Scroll.cxx +++ b/src/Fl_Scroll.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.4 2003/01/30 21:42:37 easysw Exp $" +// "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.5 2003/06/15 04:41:16 easysw Exp $" // // Scroll widget for the Fast Light Tool Kit (FLTK). // @@ -27,6 +27,14 @@ #include #include +// Clear all but the scrollbars... +void Fl_Scroll::clear() { + for (int i=children() - 1; i >= 0; i --) { + Fl_Widget* o = child(i); + if (o != &hscrollbar && o != &scrollbar) delete o; + } +} + // Insure the scrollbars are the last children: void Fl_Scroll::fix_scrollbar_order() { Fl_Widget** a = (Fl_Widget**)array(); @@ -258,5 +266,5 @@ int Fl_Scroll::handle(int event) { } // -// End of "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.4 2003/01/30 21:42:37 easysw Exp $". +// End of "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.5 2003/06/15 04:41:16 easysw Exp $". // -- cgit v1.2.3