summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES3
-rw-r--r--FL/Fl_Scroll.H5
-rw-r--r--src/Fl_Scroll.cxx12
3 files changed, 16 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 8f2beb78c..a86da0aee 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
CHANGES IN FLTK 1.1.4
+ - Fl_Scroll didn't provide its own clear() method, so
+ calling clear() on a Fl_Scroll widget would also
+ destroy the scrollbars (STR #75)
- Fl::event_text() was sometimes initialized to NULL
instead of an empty string (STR #70)
- fl_draw() didn't properly handle a trailing escaped
diff --git a/FL/Fl_Scroll.H b/FL/Fl_Scroll.H
index 1ae93ef56..1e3168713 100644
--- a/FL/Fl_Scroll.H
+++ b/FL/Fl_Scroll.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Scroll.H,v 1.5.2.3.2.3 2003/01/30 21:40:00 easysw Exp $"
+// "$Id: Fl_Scroll.H,v 1.5.2.3.2.4 2003/06/15 04:41:16 easysw Exp $"
//
// Scroll header file for the Fast Light Tool Kit (FLTK).
//
@@ -67,10 +67,11 @@ public:
int xposition() const {return xposition_;}
int yposition() const {return yposition_;}
void position(int, int);
+ void clear();
};
#endif
//
-// End of "$Id: Fl_Scroll.H,v 1.5.2.3.2.3 2003/01/30 21:40:00 easysw Exp $".
+// End of "$Id: Fl_Scroll.H,v 1.5.2.3.2.4 2003/06/15 04:41:16 easysw Exp $".
//
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 <FL/Fl_Scroll.H>
#include <FL/fl_draw.H>
+// 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 $".
//