|
|
On 11/21/20 1:29 AM Greg Ercolano wrote:
On 2020-11-20 15:22, Albrecht Schlosser wrote:
I started with Ian's code and tried my idea but it doesn't seem to work
as requested. Maybe the position and size of this invisible box (box_i)
can be changed to get the correct relations but I don't know. Would need
to look into the resizing code to see how the relations are calculated
(but not tonight).
I couldn't resist and did it...
;-
See attached file r.cxx.
Thanks -- yes, I just don't think it's possible to keep B centered doing any of the resizable
tricks we're normally used to.
Well, it *is* possible! :-)
See attached new version of 'r.cxx'. Running it and resizing makes the
layout look familiar - like test/cube.cxx which I know was the reason
you asked. ;-)
The "secret" (revealed by a little math and the code in
Fl_Group::resize()) is to put the invisible box centered over the border
between the two boxes B and C. As long as the overlap is equal on both
sides the two boxes (ab_grp and box_c) resize by the same amount and
therefore A and C resize symmetrically.
For simplicity I made all the boxes adjacent with widths 200, 100, 200,
resp. and put the invisible box on x = 250 with width = 100 (50 left of
the border and 50 right of the border). That's it!
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/b3f40ece-40c5-591a-b605-731b93582448%40online.de.
[ Direct Link to Message ] | |
|
| |