Create window at runtime from scratch

@JeanYves
This CANT work
When you call

mainWindow = New DesktopWindow

that calls the OS to set the TYPE of window - floating etc
So the window is created with that TYPE then

And later trying to do

mainWindow.Type = DesktopWindow.Types.Document

will have no effect

And its not a bug
The OS works the way it works
Its why you design the window classs with this value already set and then when you create a new instance the TYPE gets used as expected

thanks Norman for this explaination !
so not only the type but also the resizable and close button and everything ?

SOME of these things are NOT changeable at runtime after the window is created

Several properties are supposed to be Design Time Only properties but dont behave that way - I forget why that is
Possibly because on Windows & Linux you can change the type after it s created but on MacOS you cant
I really dont remember

But thats why you cant create a window of the right type from scratch the way your code reads
It just doesnt work

Sad no one there could answer you correctly

In plain Xojo code, yes, but the OS supports changing most of them. The MBS plugin, for example, allows to change closable, zoomable and minimise-able properties.