From df9acaafea434e12d21077a7806867c99217a57d Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 20 Dec 2001 14:41:44 +0000 Subject: Implement Fl::scheme() and Fl::reload_scheme() (this includes support for new FLTK_SCHEME environment variable, which should get added to FLTK 2.0 CVS, as well as the -scheme option...) Revert Fl_Group/Fl_Widget destructor change - it doesn't work for statically initialized widgets (like the widgets in a color chooser...) Export fl_round_up_box() and fl_round_down_box() so they can be restored in Fl::reload_scheme(). Use FL_DOWN_BOX and FL_ROUND_DOWN_BOX in menu drawing code. Use a static string for the display environment variable in Fl::display(). Updated MacOS README file... Added window tile image... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1883 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Group.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Fl_Group.cxx') diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx index f895c442a..1ccaaca94 100644 --- a/src/Fl_Group.cxx +++ b/src/Fl_Group.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Group.cxx,v 1.8.2.8.2.7 2001/12/19 18:40:13 easysw Exp $" +// "$Id: Fl_Group.cxx,v 1.8.2.8.2.8 2001/12/20 14:41:44 easysw Exp $" // // Group widget for the Fast Light Tool Kit (FLTK). // @@ -298,7 +298,7 @@ void Fl_Group::clear() { int old_children = children(); // clear everything now, in case fl_fix_focus recursively calls us: children_ = 0; - // array_ = 0; dont do this, it will clobber old_array if only one child + //array_ = 0; //dont do this, it will clobber old_array if only one child savedfocus_ = 0; resizable_ = this; init_sizes(); @@ -306,7 +306,7 @@ void Fl_Group::clear() { Fl_Widget*const* a = old_array; for (int i=old_children; i--;) { Fl_Widget* o = *a++; - delete o; + if (o->parent() == this) delete o; } if (old_children > 1) free((void*)old_array); } @@ -347,6 +347,7 @@ void Fl_Group::insert(Fl_Widget &o, int index) { void Fl_Group::add(Fl_Widget &o) {insert(o, children_);} void Fl_Group::remove(Fl_Widget &o) { + if (!children_) return; int i = find(o); if (i >= children_) return; if (&o == savedfocus_) savedfocus_ = 0; @@ -551,5 +552,5 @@ void Fl_Group::draw_outside_label(const Fl_Widget& w) const { } // -// End of "$Id: Fl_Group.cxx,v 1.8.2.8.2.7 2001/12/19 18:40:13 easysw Exp $". +// End of "$Id: Fl_Group.cxx,v 1.8.2.8.2.8 2001/12/20 14:41:44 easysw Exp $". // -- cgit v1.2.3