Window Placement?

Greetings -

The LR simply says:
Placement? The location where the window appears when it opens:
• Default
• Parent Window
• Main Screen
• Parent Window Screen
• Stagger

Ditto the UG.

But, exactly what do these mean? Nothing seems to say! Surely, they must have some standard meaning, even if platform dependent. I’m really surprised that this is “documented” so vaguely!

Any takers?

Thanks
Jim Wagner
Oregon Research Electronics

I see that this was was slightly addressed here:

https://forum.xojo.com/7405-window-placement-clarification-needed

But, why do some windows place themselves in the center of the display while others do so in the upper left corner? What do you need to do to have a window show consistently center-display?

Jim

[quote=68218:@James Wagner]What do you need to do to have a window show consistently center-display?

[/quote]

Place this in the window Open event :

[code]Sub Open()

me.Left = (Screen(0).AvailableWidth-me.Width)/2
me.Top = (Screen(0).AvailableHeight-me.Height)/2

End Sub
[/code]

So that over-rides the placement property?

Thanks, Jim

No. It simply places the window squarely in the center of the main screen.

They vary from platform to platform is one reason they are not enumerated

I don’t have a Windows PC with multiple monitors so I can’t confirm how the “screen” behaviors work

On OS X the “default” is to stagger new windows slightly down & right of the last one created (more or less but there are some requirements about the last one still being open etc and then it staggers dow from that one) Windows is similar

On OS X Main screen means basically “the monitor with the menu bar” - when you have many monitors you can move the main menu bar around. I’m not 100% sure of the meaning for Windows but I suspect it has something similar in terms of the “main” monitor when you have several attached

Parent Window screen is kind of odd - say you have a window with a pushbutton that causes another window to open
Where the window with that pushbutton is will determine where the new window shows up - that same “parent” windows screen
But not necessarily right next to the window that had the push button on it - the same screen with OS defined staggering behaviour.
I believe Windows will do something similar

Parent window means something slightly different - the new window shows on the same screen but staggered from the window that caused this other one to open. This is true on Windows & OS X

On OS X you don’t usually just open a new window right on top of another - hence why the behaviors typically stagger slightly
Otherwise you could have a new window open & a user would NOT notice it

So to override the normal behavior you do have to write a couple lines like michel posted as its NOT normal
Main screen is more than likely as close as your going to get on OS X and behave “normally” like folks more or less expect