Hi,
I'm building a window with dynamic added gadgets inside.
All works but I wonder how to know the Width and Height of a window BEFORE to open it.
I want to use these informations to position my window on the screen before to open it without to use WINDOW_Position.
Is it possible ?
the following function returns "0 x 0" before WM_OPEN and "476 x 68" after that the window is opened
uint32 Width = 0 ; uint32 Height = 0 ; GetAttrs(win,WA_Width,&Width,WA_Height, &Height,TAG_DONE); printf("%ld x %ld \n",Width,Height); window = (struct Window *)IDoMethod(win, WM_OPEN); GetAttrs(win,WA_Width,&Width,WA_Height, &Height,TAG_DONE); printf("%ld x %ld \n",Width,Height);
Thank you by advance.
ILayout->LayoutLimits() will enable you to determine the size of the layout and hence the values of WA_InnerWidth and WA_InnerHieght, but the other details depend on the user preferences for border styles etc.
Unless your window is borderless of course ....
What's wrong with WINDOW_Position ?
Thank you, LayoutLimits is was I needed, it gives me my window dimensions. Wonderful.
And as my window is borderless, no problem.
WINDOW_Position is not useful for my case because, I want to be able to specify where will be located my window according to his width and/or height.
For example, at X = 500 but at the extrem right of my screen. To be able to make that, I have to know at least the width of my window.
Maybe that I understad wrong the autodocs but I don't find a suitable WPOS for my need.
WPOS_CENTERSCREEN - Center on screen
WPOS_CENTERWINDOW - Center in another window
WPOS_CENTERMOUSE - Center under mouse
WPOS_TOPLEFT - Open top/left, just below screen bar
WPOS_FULLSCREEN - Open top/left and fill visible clip
Thank you again for your help, Broadblues ;)