Page 1 of 1

WindowX() offset with #PB_Window_SizeGadget

Posted: Thu May 02, 2024 10:08 am
by dige
I wanted to place a splash screen exactly over the main window and had an offset of approx. 8 pixels.

If the main window was created with the style #PB_Window_SizeGadget, then the value determined with WindowX(main window) is different than without.

Code: Select all

#hWnd = 0

OpenWindow(0, 200, 400, 500, 400, "Main Window", #PB_Window_SystemMenu|#PB_Window_SizeGadget)

OpenWindow(1, WindowX(#hWnd), WindowY(#hwnd) + 30, WindowWidth(#hWnd), WindowHeight(#hWnd), "#PB_Window_SystemMenu", #PB_Window_SystemMenu, WindowID(#hWnd))
  
OpenWindow(2, WindowX(#hWnd), WindowY(#hwnd) + 60, WindowWidth(#hWnd), WindowHeight(#hWnd), "#PB_Window_BorderLess", #PB_Window_BorderLess, WindowID(#hWnd))

OpenWindow(3, WindowX(#hWnd), WindowY(#hwnd) + 90, WindowWidth(#hWnd), WindowHeight(#hWnd), "#PB_Window_SizeGadget", #PB_Window_SizeGadget, WindowID(#hWnd))

Repeat
  
  
Until WaitWindowEvent() = #PB_Event_CloseWindow
What's the reason for this?

Re: WindowX() offset with #PB_Window_SizeGadget

Posted: Thu May 02, 2024 10:53 am
by BarryG

Re: WindowX() offset with #PB_Window_SizeGadget

Posted: Thu May 02, 2024 1:28 pm
by dige
Ok, thanks for the hint. Once again I thought I was the first one on the moon :oops: