summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2004-04-06 02:47:26 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2004-04-06 02:47:26 +0000
commit4e0450ea36afc824a57502de155165c357d72900 (patch)
tree77a4e1a8076250851976a39c0f1e49b22211b052
parent70ca1d156ba8bb0aa1b3a925b89f935fe4dccfbe (diff)
FLUID crashed if you did layout with a window widget (STR #317)
Fl_Scroll::clear() didn't remove the child widget from the Fl_Scroll widget (STR #327) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3297 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES4
-rw-r--r--fluid/align_widget.cxx30
-rw-r--r--src/Fl_Scroll.cxx9
3 files changed, 25 insertions, 18 deletions
diff --git a/CHANGES b/CHANGES
index 3a90e808d..dbe83f348 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@ CHANGES IN FLTK 1.1.5rc1
- Documentation updates (STR #245, STR #250, STR #277,
STR #281)
+ - FLUID crashed if you did layout with a window widget
+ (STR #317)
+ - Fl_Scroll::clear() didn't remove the child widget from
+ the Fl_Scroll widget (STR #327)
- Fl_Value_Slider::draw_bg() didn't always apply the
clipping rectangle (STR #235)
- fl_filename_relative() returned the wrong string if
diff --git a/fluid/align_widget.cxx b/fluid/align_widget.cxx
index dff5c2e16..6f90424e5 100644
--- a/fluid/align_widget.cxx
+++ b/fluid/align_widget.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: align_widget.cxx,v 1.1.2.3 2003/08/02 21:17:30 easysw Exp $"
+// "$Id: align_widget.cxx,v 1.1.2.4 2004/04/06 02:47:25 easysw Exp $"
//
// alignment code for the Fast Light Tool Kit (FLTK).
//
@@ -59,7 +59,7 @@ void align_widget_cb(Fl_Widget*, long how)
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
w->resize(left, w->y(), w->w(), w->h());
w->redraw();
- w->window()->redraw();
+ if (w->window()) w->window()->redraw();
}
break;
case 11: // align h.center
@@ -83,7 +83,7 @@ void align_widget_cb(Fl_Widget*, long how)
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
w->resize((center2-w->w())/2, w->y(), w->w(), w->h());
w->redraw();
- w->window()->redraw();
+ if (w->window()) w->window()->redraw();
}
}
break;
@@ -104,7 +104,7 @@ void align_widget_cb(Fl_Widget*, long how)
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
w->resize(right-w->w(), w->y(), w->w(), w->h());
w->redraw();
- w->window()->redraw();
+ if (w->window()) w->window()->redraw();
}
break;
case 13: // align top
@@ -124,7 +124,7 @@ void align_widget_cb(Fl_Widget*, long how)
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
w->resize(w->x(), top, w->w(), w->h());
w->redraw();
- w->window()->redraw();
+ if (w->window()) w->window()->redraw();
}
break;
case 14: // align v.center
@@ -148,7 +148,7 @@ void align_widget_cb(Fl_Widget*, long how)
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
w->resize(w->x(), (center2-w->h())/2, w->w(), w->h());
w->redraw();
- w->window()->redraw();
+ if (w->window()) w->window()->redraw();
}
}
break;
@@ -169,7 +169,7 @@ void align_widget_cb(Fl_Widget*, long how)
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
w->resize( w->x(), bot-w->h(), w->w(), w->h());
w->redraw();
- w->window()->redraw();
+ if (w->window()) w->window()->redraw();
}
break;
//---- space evently
@@ -197,7 +197,7 @@ void align_widget_cb(Fl_Widget*, long how)
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
w->resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h());
w->redraw();
- w->window()->redraw();
+ if (w->window()) w->window()->redraw();
cnt++;
wsum += w->w();
}
@@ -227,7 +227,7 @@ void align_widget_cb(Fl_Widget*, long how)
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
w->resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h());
w->redraw();
- w->window()->redraw();
+ if (w->window()) w->window()->redraw();
cnt++;
hsum += w->h();
}
@@ -251,7 +251,7 @@ void align_widget_cb(Fl_Widget*, long how)
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
w->resize( w->x(), w->y(), wdt, w->h());
w->redraw();
- w->window()->redraw();
+ if (w->window()) w->window()->redraw();
}
break;
case 31: // same height
@@ -271,7 +271,7 @@ void align_widget_cb(Fl_Widget*, long how)
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
w->resize( w->x(), w->y(), w->w(), hgt);
w->redraw();
- w->window()->redraw();
+ if (w->window()) w->window()->redraw();
}
break;
case 32: // same size
@@ -293,7 +293,7 @@ void align_widget_cb(Fl_Widget*, long how)
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
w->resize( w->x(), w->y(), wdt, hgt);
w->redraw();
- w->window()->redraw();
+ if (w->window()) w->window()->redraw();
}
break;
//---- center in group
@@ -306,7 +306,7 @@ void align_widget_cb(Fl_Widget*, long how)
int center2 = 2*p->x()+p->w();
w->resize((center2-w->w())/2, w->y(), w->w(), w->h());
w->redraw();
- w->window()->redraw();
+ if (w->window()) w->window()->redraw();
}
break;
case 41: // center vert
@@ -318,7 +318,7 @@ void align_widget_cb(Fl_Widget*, long how)
int center2 = 2*p->y()+p->h();
w->resize(w->x(), (center2-w->h())/2, w->w(), w->h());
w->redraw();
- w->window()->redraw();
+ if (w->window()) w->window()->redraw();
}
break;
}
@@ -326,6 +326,6 @@ void align_widget_cb(Fl_Widget*, long how)
//
-// End of "$Id: align_widget.cxx,v 1.1.2.3 2003/08/02 21:17:30 easysw Exp $".
+// End of "$Id: align_widget.cxx,v 1.1.2.4 2004/04/06 02:47:25 easysw Exp $".
//
diff --git a/src/Fl_Scroll.cxx b/src/Fl_Scroll.cxx
index 6e2f6a7a7..7508a980a 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.6 2004/03/11 05:17:12 easysw Exp $"
+// "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.7 2004/04/06 02:47:26 easysw Exp $"
//
// Scroll widget for the Fast Light Tool Kit (FLTK).
//
@@ -31,7 +31,10 @@
void Fl_Scroll::clear() {
for (int i=children() - 1; i >= 0; i --) {
Fl_Widget* o = child(i);
- if (o != &hscrollbar && o != &scrollbar) delete o;
+ if (o != &hscrollbar && o != &scrollbar) {
+ remove(o);
+ delete o;
+ }
}
}
@@ -268,5 +271,5 @@ int Fl_Scroll::handle(int event) {
}
//
-// End of "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.6 2004/03/11 05:17:12 easysw Exp $".
+// End of "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.7 2004/04/06 02:47:26 easysw Exp $".
//