Index: FL/Fl_Group.H
===================================================================
--- FL/Fl_Group.H	(revision 12258)
+++ FL/Fl_Group.H	(working copy)
@@ -26,6 +26,19 @@
 #include "Fl_Widget.H"
 #endif
 
+class Fl_Rect { // temporarily put here
+private:
+  int x_, y_, w_, h_;
+public:
+  Fl_Rect(int x=0, int y=0, int w=0, int h=0) : x_(x), y_(y), w_(w), h_(h) {}
+  int x() {return x_;}
+  int y() {return y_;}
+  int w() {return w_;}
+  int h() {return h_;}
+  int r() {return x_ + w_;}
+  int b() {return y_ + h_;}
+};
+
 /**
   The Fl_Group class is the FLTK container widget. It maintains
   an array of child widgets. These children can themselves be any widget
@@ -44,7 +57,7 @@
   Fl_Widget* savedfocus_;
   Fl_Widget* resizable_;
   int children_;
-  int *sizes_; // remembered initial sizes of children
+  Fl_Rect *bounds_; // remembered initial sizes of children
 
   int navigation(int);
   static Fl_Group *current_;
@@ -60,6 +73,7 @@
   void draw_outside_label(const Fl_Widget& widget) const ;
   void update_child(Fl_Widget& widget) const;
   int  *sizes();
+  Fl_Rect *bounds();
 
 public:
 
Index: src/Fl_Group.cxx
===================================================================
--- src/Fl_Group.cxx	(revision 12258)
+++ src/Fl_Group.cxx	(working copy)
@@ -363,7 +363,7 @@
   array_ = 0;
   savedfocus_ = 0;
   resizable_ = this;
-  sizes_ = 0; // this is allocated when first resize() is done
+  bounds_ = 0; // this is allocated when first resize() is done
   // Subclasses may want to construct child objects as part of their
   // constructor, so make sure they are add()'d to this object.
   // But you must end() the object!
@@ -566,13 +566,14 @@
   \sa sizes()
 */
 void Fl_Group::init_sizes() {
-  delete[] sizes_; sizes_ = 0;
+  delete[] (char*)bounds_;
+  bounds_ = 0;
 }
 
 /**
   Returns the internal array of widget sizes and positions.
 
-  If the sizes() array does not exist, it will be allocated and filled
+  If the bounds() array does not exist, it will be allocated and filled
   with the current widget sizes and positions.
 
   \note You should never need to use this method directly, unless you have
@@ -580,42 +581,57 @@
   this to rearrange its widget positions.
   
   \sa init_sizes()
-
-  \todo Should the internal representation of the sizes() array be documented?
 */
-int* Fl_Group::sizes() {
-  if (!sizes_) {
-    int* p = sizes_ = new int[4*(children_+2)];
-    // first thing in sizes array is the group's size:
-    if (type() < FL_WINDOW) {p[0] = x(); p[2] = y();} else {p[0] = p[2] = 0;}
-    p[1] = p[0]+w(); p[3] = p[2]+h();
+Fl_Rect* Fl_Group::bounds() {
+  if (!bounds_) {
+    //Fl_Rect* p = bounds_ = new Fl_Rect[children_+2]; // this repeatedly calls the Fl_Rect constructor
+    Fl_Rect* p = bounds_ = (Fl_Rect*)new char[(children_+2)*sizeof(Fl_Rect)];
+    // first thing in bounds array is the group's size:
+    int left, top, right, bottom;
+    if (type() < FL_WINDOW) {left = x(); top = y();} else {left = top = 0;}
+    p[0] = Fl_Rect(left, top, w(), h());
     // next is the resizable's size:
-    p[4] = p[0]; // init to the group's size
-    p[5] = p[1];
-    p[6] = p[2];
-    p[7] = p[3];
+    right = p->r(); // init to the group's size
+    bottom = p->b();
     Fl_Widget* r = resizable();
     if (r && r != this) { // then clip the resizable to it
       int t;
-      t = r->x(); if (t > p[0]) p[4] = t;
-      t +=r->w(); if (t < p[1]) p[5] = t;
-      t = r->y(); if (t > p[2]) p[6] = t;
-      t +=r->h(); if (t < p[3]) p[7] = t;
+      t = r->x(); if (t > left) left = t;
+      t +=r->w(); if (t < right) right = t;
+      t = r->y(); if (t > top) top = t;
+      t +=r->h(); if (t < bottom) bottom = t;
     }
+    p[1] = Fl_Rect(left, top, right-left, bottom-top);
     // next is all the children's sizes:
-    p += 8;
+    p += 2;
     Fl_Widget*const* a = array();
     for (int i=children_; i--;) {
       Fl_Widget* o = *a++;
-      *p++ = o->x();
-      *p++ = o->x()+o->w();
-      *p++ = o->y();
-      *p++ = o->y()+o->h();
+      *p++ = Fl_Rect(o->x(), o->y(), o->w(), o->h());
     }
   }
-  return sizes_;
+  return bounds_;
 }
 
+/**   Returns the internal array of widget sizes and positions.
+For backward compatibility with FLTK versions before 1.4.
+Fl_Group::bounds() is now the preferred interface.
+Use delete[] after usage.
+ */
+int* Fl_Group::sizes()
+{
+  int* p = new int[4*(children_+2)];
+  int *q = p;
+  for (int i = 0; i < children_+2; i++) {
+    q[0] = (bounds()+i)->x();
+    q[1] = (bounds()+i)->r();
+    q[2] = (bounds()+i)->y();
+    q[3] = (bounds()+i)->b();
+    q += 4;
+  }
+  return p;
+}
+
 /**
   Resizes the Fl_Group widget and all of its children.
 
@@ -634,7 +650,7 @@
   int dw = W-w();
   int dh = H-h();
   
-  int *p = sizes(); // save initial sizes and positions
+  Fl_Rect* p = bounds(); // save initial sizes and positions
 
   Fl_Widget::resize(X,Y,W,H); // make new xywh values visible for children
 
@@ -651,48 +667,47 @@
   } else if (children_) {
 
     // get changes in size/position from the initial size:
-    dx = X - p[0];
-    dw = W - (p[1]-p[0]);
-    dy = Y - p[2];
-    dh = H - (p[3]-p[2]);
+    dx = X - p->x();
+    dw = W - p->w();
+    dy = Y - p->y();
+    dh = H - p++->h();
     if (type() >= FL_WINDOW) dx = dy = 0;
-    p += 4;
 
     // get initial size of resizable():
-    int IX = *p++;
-    int IR = *p++;
-    int IY = *p++;
-    int IB = *p++;
+    int IX = p->x();
+    int IR = p->r();
+    int IY = p->y();
+    int IB = p++->b();
 
     Fl_Widget*const* a = array();
     for (int i=children_; i--;) {
       Fl_Widget* o = *a++;
 #if 1
-      int XX = *p++;
+      int XX = p->x();
       if (XX >= IR) XX += dw;
       else if (XX > IX) XX = IX+((XX-IX)*(IR+dw-IX)+(IR-IX)/2)/(IR-IX);
-      int R = *p++;
+      int R = p->r();
       if (R >= IR) R += dw;
       else if (R > IX) R = IX+((R-IX)*(IR+dw-IX)+(IR-IX)/2)/(IR-IX);
 
-      int YY = *p++;
+      int YY = p->y();
       if (YY >= IB) YY += dh;
       else if (YY > IY) YY = IY+((YY-IY)*(IB+dh-IY)+(IB-IY)/2)/(IB-IY);
-      int B = *p++;
+      int B = p++->b();
       if (B >= IB) B += dh;
       else if (B > IY) B = IY+((B-IY)*(IB+dh-IY)+(IB-IY)/2)/(IB-IY);
 #else // much simpler code from Francois Ostiguy:
-      int XX = *p++;
+      int XX = p->x();
       if (XX >= IR) XX += dw;
       else if (XX > IX) XX += dw * (XX-IX)/(IR-IX);
-      int R = *p++;
+      int R = p->r();
       if (R >= IR) R += dw;
       else if (R > IX) R = R + dw * (R-IX)/(IR-IX);
 
-      int YY = *p++;
+      int YY = p->y();
       if (YY >= IB) YY += dh;
       else if (YY > IY) YY = YY + dh*(YY-IY)/(IB-IY);
-      int B = *p++;
+      int B = p++->b();
       if (B >= IB) B += dh;
       else if (B > IY) B = B + dh*(B-IY)/(IB-IY);
 #endif
Index: src/Fl_Tile.cxx
===================================================================
--- src/Fl_Tile.cxx	(revision 12258)
+++ src/Fl_Tile.cxx	(working copy)
@@ -216,25 +216,25 @@
     int oldx = 0;
     int oldy = 0;
     Fl_Widget*const* a = array();
-    int *q = sizes();
-    int *p = q+8;
-    for (int i=children(); i--; p += 4) {
+    Fl_Rect *q = bounds();
+    Fl_Rect *p = q+2;
+    for (int i=children(); i--; p++) {
       Fl_Widget* o = *a++;
       if (o == resizable()) continue;
-      if (p[1]<q[1] && o->y()<=my+GRABAREA && o->y()+o->h()>=my-GRABAREA) {
+      if (p->r() < q->r() && o->y()<=my+GRABAREA && o->y()+o->h()>=my-GRABAREA) {
 	int t = mx - (o->x()+o->w());
 	if (abs(t) < mindx) {
 	  sdx = t;
 	  mindx = abs(t);
-	  oldx = p[1];
+	  oldx = p->r()/*p[1]*/;
 	}
       }
-      if (p[3]<q[3] && o->x()<=mx+GRABAREA && o->x()+o->w()>=mx-GRABAREA) {
+      if (p->b() < q->b() && o->x()<=mx+GRABAREA && o->x()+o->w()>=mx-GRABAREA) {
 	int t = my - (o->y()+o->h());
 	if (abs(t) < mindy) {
 	  sdy = t;
 	  mindy = abs(t);
-	  oldy = p[3];
+	  oldy = p->b();
 	}
       }
     }
