I can’t figure this out, I have a mainwindow which displays top left of screen when opened (would like to centre it, but thats probably another thread).
I call a new window with ‘window1.showmodalwithin(main window)’
No matter what window type I select (Modal dialog, document, etc) it displays in the centre of the screen. I would really like it to display in the centre of mainwindow from which it was called and is the parent.
I have tried changing the placement also.
Any ideas? Preferably without having to set top and bottom values.
Sounds like a ‘VB used to do this’ situation.
It had a ‘startPosition’ property of a form which woulb be set to ‘CenterParent’ or similar.
Xojo doesnt.
All works well now, however…
when the window is called (modal dialog) it does not have focus. It displays on top of mainwindow but mainwindow keeps the focus, I have to click on the dialog to shift the focus to it, then all works well.
Just noticed, this only occurs in the startup routine.
In the open event of mainwindow i call window1 which does not get the focus as described above.
However, once I’m finished with window1 and close it, i have a button on mainwindow that calls it again. If called with the button, it gets the focus fine.
So it only happens when called from the mainwindow open event. Is there a way of fixing this? Should i be using a different event?
I want window1 to open at start, but over top of mainwindow.
set the apps default window to none (was mainwindow)
in the app open event, call mainwindow, then call window1
Works as expected.
Must have been the default window setting in the app.