diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 1998-12-29 13:59:48 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 1998-12-29 13:59:48 +0000 |
| commit | a35b7387f5dd22cd692d13153f7d4c3dafe3b776 (patch) | |
| tree | 1565f5aa21d764fa2de5891fb6b3bbdb235ea5a3 | |
| parent | cbd4a2813272a15c66665af07fe5716fafcecada (diff) | |
Fixed Fl_Group::add()...
git-svn-id: file:///fltk/svn/fltk/trunk@170 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | src/Fl_Group.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx index 795371101..2fe400e2f 100644 --- a/src/Fl_Group.cxx +++ b/src/Fl_Group.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Group.cxx,v 1.4 1998/10/21 14:20:07 mike Exp $" +// "$Id: Fl_Group.cxx,v 1.5 1998/12/29 13:59:48 mike Exp $" // // Group widget for the Fast Light Tool Kit (FLTK). // @@ -260,13 +260,14 @@ void Fl_Group::insert(Fl_Widget &o, int i) { } else if (children_ == 1) { // go from 1 to 2 children Fl_Widget* t = (Fl_Widget*)array_; array_ = (Fl_Widget**)malloc(2*sizeof(Fl_Widget*)); - array_[!i] = t; array_[i] = &o; + if (i) {array_[0] = t; array_[1] = &o;} + else {array_[0] = &o; array_[1] = t;} } else { if (!(children_ & (children_-1))) // double number of children array_ = (Fl_Widget**)realloc((void*)array_, 2*children_*sizeof(Fl_Widget*)); - for (int j = children_; j > i; j--) array_[j] = array_[j-1]; - array_[i] = &o; + int j; for (j = children_; j > i; j--) array_[j] = array_[j-1]; + array_[j] = &o; } children_++; init_sizes(); @@ -465,5 +466,5 @@ void Fl_Group::draw_outside_label(const Fl_Widget& w) const { } // -// End of "$Id: Fl_Group.cxx,v 1.4 1998/10/21 14:20:07 mike Exp $". +// End of "$Id: Fl_Group.cxx,v 1.5 1998/12/29 13:59:48 mike Exp $". // |
