I played around with your example and found it still worked if I increased
the width of the window and box C so that A and C are not symmetrical,
but once you introduce padding between the boxes, things go a bit awry.
See the attached, where I've also moved/coloured box I to make it visible.
The fix might be obvious to you if you've been looking at the resize code.
D.
On Saturday, November 21, 2020 at 3:41:33 AM UTC+1 Albrecht Schlosser wrote:
On 11/21/20 3:14 AM duncan wrote:
> 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'.