Resized and Resizing

I just finished creating a new DesktopContainer for my app, to replace an existing one that uses an HTMLViewer. In an HTMLViewer, you can resize it and it will re-render and the text flows into the new space, without any coding effort needed on my part. My replacement uses a DesktopTextarea instead, so I have to do a bit of work to make sure the scrollbar appears as needed, and calculate what the new height should be as the user makes it wider or narrower.

So I have a Resizing event on the Container, and do the calcs and adjustments there. This was in the little Testbed app I used while developing the Container.

The new Container should just have slotted into my app to replace the old HTML-using Container, but it didn’t work. Pretty soon I see that the Resizing event is not firing at all. Pretty soon after that I remember some Linux nonsense in my app where I have to use Resized instead of Resizing. So I make that change for the app, which I’m doing under macOS, and well well, it works exactly like Resizing ought to have been working. And it seems to fire continuously, too, not just when I mouse-up after dragging the container edge.

Why do I need to use Resized here instead of Resizing?

ContainerControl seems to fire only for Resized.

To get Resizing, you could use a timer that measures width+height, and if it differs from previous width+height saved in a static variable, then you have your resizing event.

OK. I see the two Resizing event handlers in my app are on windows. Oh - and I see I have six Resized event handlers, on DesktopContainers - I must have forgotten. Ah me - age gets you in the end, you end up solving the same problem more than once. I also see that there is an extra Resized, on a Window for Linux.

Still doesn’t explain why Resized on a Container behaves just like Resizing on a Window.