summaryrefslogtreecommitdiff
path: root/src/Fl_Value_Input.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2009-01-08 17:12:34 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2009-01-08 17:12:34 +0000
commiteec7f80e949dd78874741a6c17fe66ec74cec3a5 (patch)
tree74a1d08ed3432f34d73af19b751cec2705217e4e /src/Fl_Value_Input.cxx
parent601a0f0d3efd46b0ef6c34a98cd738bceaae504c (diff)
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
Diffstat (limited to 'src/Fl_Value_Input.cxx')
-rw-r--r--src/Fl_Value_Input.cxx6
1 files changed, 6 insertions, 0 deletions
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$".
//