> Huh? I don't understand the question.
> You get the size of a button just by calling its w() and h() methods.
> What property of the widget are you trying to measure other than its
> width and height?
>

The w() and h() methods return the size that the user requested when the widget 
was created or resized.  What I want is the "shrink-wrap" size.
For labels and buttons it is the size of the label and/or image and the 
surrounding box.

For example:

void fl_Widget_shrinkwrap_size(Widget *o, int* sizes) {
  int w,h;
  o->measure(w,h);
  if (w > 5 && o->align()&(fltk3::ALIGN_LEFT|fltk3::ALIGN_RIGHT)) {w += 6;}

  sizes[0]=w + fltk3::box_dw(o->box());
  sizes[1]=h + fltk3::box_dh(o->box());
}

_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to