From eec7f80e949dd78874741a6c17fe66ec74cec3a5 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Thu, 8 Jan 2009 17:12:34 +0000 Subject: Widgets now remove themselves from their parent group (if any), when destroyed (STR #1894). Fl_Group::clear() removes widget by widget (one at a time) to allow widgets to remove other related widgets from the same group, when they are deleted. Also fixed a bug in Fl_Value_Input (added a destructor), because it used a non-Fl_Group widget as parent of another widget. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6623 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Value_Input.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Fl_Value_Input.cxx') diff --git a/src/Fl_Value_Input.cxx b/src/Fl_Value_Input.cxx index eb741c1c7..1ac7a6958 100644 --- a/src/Fl_Value_Input.cxx +++ b/src/Fl_Value_Input.cxx @@ -136,6 +136,12 @@ Fl_Value_Input::Fl_Value_Input(int X, int Y, int W, int H, const char* l) set_flag(SHORTCUT_LABEL); } +Fl_Value_Input::~Fl_Value_Input() { + + if (input.parent() == (Fl_Group *)this) + input.parent(0); // *revert* ctor kludge! +} + // // End of "$Id$". // -- cgit v1.2.3