How to tell whether the user or code is resizing a window?

From the reference:

[code]Window.Resized ( )

The window has been resized by the user or by code that changes the window’s Width or Height properties.[/code]

But I have some code resizing the window and do not want this to change some properties, I only want the properties to change when the user resizes the window. How can I do this?

Resizing only fires when the user is “in the process”, but as soon as he is done, “resized” fires, right?

I made a short test. (in Linux)

Resizing never fired, Resized fires on beginning resizing the window.

This confuses me a little.

Since it seems to be about the Resizing and Resized event not firing when they are supposed to, I did encounter that before, in ContainerControls, where Resizing and Resized do not fire, among others.

The workaround I found was to have a 100 ms multiple timer monitor Width and Height, so these events can be detected. For a perfectly smooth live resize, a resolution of 17 ms (60 frames/second) is probably better if you must resize stuff yourself.

Now to discriminate between code and user. If it is code, it does not seem terribly difficult to set a flag when your own code resizes the window so you know it does. But anyway, it is fairly simple to look where the mouse cursor is. When it is between -10 and +10 pixels of any window border (bounds.top, left, right, bottom), the resize is initiated by the user.

That said, Dave, it is always a pity when the guy who initiated the thread deletes his post. So nobody understands what it is about. I think it is rude and careless. Please abstain to do that in the future.

45495 - Forum : Prevent people to delete the post that initiated the thread
Status: Needs Review Rank: Not Ranked Product: Xojo Category: N/A

Michel Bujardet Today at 7:09 PM
See How to tell whether the user or code is resizing a window? - General - Xojo Programming Forum

When the guy who created the thread deletes his original post, the entire thread becomes unitelligible.

Please prevent people from deleting the first post in a thread.

<https://xojo.com/issue/45495>

I would assume that if it were the user, system.mouseDown would be true?

Accessibility features break this assumption.

Then all that remains is probably to set a flag. Which should definitely not be out of grasp for any programmer.

I always forget about these things.

Yeah, I’d go with that.