Silverfrost Forums

Welcome to our forums

Creating a non-visible window

30 May 2006 2:36 #702

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

30 May 2006 4:51 #703

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.

30 May 2006 6:08 #704

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.

Please login to reply.