Nice. It even works if you increase the width of the window and the
width of box C.
It's the combination of width of B and starting at the middle of B that
does it.
Well, yes, that does it. I apologize if the following sounds like
nitpicking, but to make sure the mechanics are clear:
It has nothing to do with the width of B and the width of the invisible
box (if that's what you meant): they are not related. The condition that
must be met is that the invisible box is centered over the border
between B and C. That's all.
You'll see this if you replace the relevant code of my 2nd version with
this:
int d = 1;
box_i = new Fl_Box(300-d, 24, 2*d, 37, ""); // invisible box
box_i->box(FL_NO_BOX);
main_win->resizable(box_i);
where X = 300 - d and W = 2 * d to center it between B and C (at 300).
You can vary d in a sensible range (1 - 200) but something goes awry if
you make it larger than 200 because it crosses the window borders.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.