View previous topic :: View next topic |
Author |
Message |
acw
Joined: 04 Nov 2005 Posts: 165 Location: Darkest Devon
|
Posted: Tue May 30, 2006 3:36 am Post subject: Creating a non-visible window |
|
|
Is there any way of creating a clearwin window initially hidden, so that its position can be changed (and controls modified) before making it visible without having it flash up in its default location first. I can't just use %sy to set its position as I need to get the window size.
BTW - I need to reposition after creation because its a %di window which is not initially positioned in the centre of the screen, unlike standard clearwin windows (%di windows seem to have their upper-left corner in the centre).
Thanks
Alan |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Tue May 30, 2006 5:51 am Post subject: Creating a non-visible window |
|
|
Alan
Have you tried using STYLE DS_CENTER in the script for the dialog?
Otherwise you could set the initial position somewhere way off screen so it cannot be seen.
A better solution may be to use GET_WINDOW_LOCATION@ from a %sc callback. This gives the size as well as the position. |
|
Back to top |
|
|
acw
Joined: 04 Nov 2005 Posts: 165 Location: Darkest Devon
|
Posted: Tue May 30, 2006 7:08 am Post subject: Creating a non-visible window |
|
|
The resource does have STYLE DS_CENTER but this doesn't seem have any effect. Actually I think it does, its just that its the top-left of the dialog that is centred for some reason (is this perhaps a ClearWin buggette with %di windows - I've noticied it before ?).
I currently use GET_WINDOW_LOCATION@ within the dialog startup function and centre it manually which is fine, its just you see it briefly in its original position - hence the query about whether it can be created hidden. I guess creating it somewhere off screen would be a reasonable approach if I can't create it hidden.
I have also tried setting (or rather not setting) the dialog WS_VISIBLE style but the dialog still appears. |
|
Back to top |
|
|
|