enable/disable resizing window programmatically

Hi,

I cannot figure out a very trivial thing. I have window, which is set as not resizable in the IDE. Now, under some circumstances I want to make it resizable, but I could not find a way to do so as the Resizable method in the Window class is read-only.

What am I missing?

Thanks.

Check min and max size

Yes that was one possibility I considered, however, when I don’t want to resize (so I set the min to the window size) the pointer icon still changes when hovering on the window border…

Windows ? Mac ?

Because the window hints are configured when the window is created, and since the UI manager in the OS manages the mouse cursor over those areas of the window, you’re very limited. Setting the min and max values to the current size values is the only way to do it.

One trick that I did back in the day on Windows was to post a modal dialog, create a new window duplicating the first but with the resizing hints turned off, display the new window behind the original window - matching the X/Y coordinates, close the old window and modal dialog. It took someone really monitoring the taskbar to see the swap.

Mac only for the time being (even though I should make a Windows version too sooner or later…)

[quote=283045:@Tim Jones]
One trick that I did back in the day on Windows was to post a modal dialog, create a new window duplicating the first but with the resizing hints turned off, display the new window behind the original window - matching the X/Y coordinates, close the old window and modal dialog. It took someone really monitoring the taskbar to see the swap.[/quote]

This is interesting. I should give it a try. Thanks!

I am not as fluent in Mac declares, but there should be ways to make the window not resizable dynamically.

I hope a Mac declare guru will post a solution.

There was a discussion in the same vein where a declare was posted :
https://www.google.com/url?q=http://forum.xojo.com/17545-disable-resizing-window-from-top-nswindowdelegate/0&sa=U&ved=0ahUKEwi31oud2NDOAhVCaRQKHScwBk8QFggEMAA&client=internal-uds-cse&usg=AFQjCNGgFMmrbmd5g6QxlaCsBO0F6dTm5Q

But Tim solution should work fine.