Page 1 of 1
Window width is wrong (bug or no bug?)
Posted: Thu Oct 05, 2017 12:08 pm
by infratec
Hi,
Code: Select all
OpenWindow(0, 0, 0, 120, 120, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Debug Str(WindowWidth(0)) + "x" + Str(WindowHeight(0))
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
My debug output (and the real size):
130x120
Win10 x64 and PB 5.61 x86
Bernd
Re: Window width is wrong
Posted: Thu Oct 05, 2017 12:13 pm
by kenmo
It's an OS limitation, you have to specify the BorderLess flag or else the OS puts a minimum size on your window (seems to be 126x10 for me).
Code: Select all
OpenWindow(0, 0, 0, 120, 120, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_BorderLess)
Debug Str(WindowWidth(0)) + "x" + Str(WindowHeight(0))
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Re: Window width is wrong
Posted: Thu Oct 05, 2017 12:15 pm
by infratec
Ups... never recognized such a behaviour.
Normally my windows are larger

Re: [Done]Window width is wrong
Posted: Thu Oct 05, 2017 12:31 pm
by nco2k
you can use WindowBounds(#Window, MinWidth, MinHeight, MaxWidth, MaxHeight) to change the default size limits.
c ya,
nco2k
Re: [Done]Window width is wrong
Posted: Thu Oct 05, 2017 12:39 pm
by infratec
An additional ResizeWindow() is needed too:
Code: Select all
OpenWindow(0, 0, 0, 100, 100, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Debug Str(WindowWidth(0)) + "x" + Str(WindowHeight(0))
WindowBounds(0, 1, 1, #PB_Ignore, #PB_Ignore)
ResizeWindow(0, #PB_Ignore, #PB_Ignore, 100, 100)
Debug Str(WindowWidth(0)) + "x" + Str(WindowHeight(0))
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
But then I think it is a bug.
This should be the default, or it should be mentioned in the help.
I checked 15 minutes why my image was not centered correctly

Re: [Done]Window width is wrong
Posted: Thu Oct 05, 2017 6:08 pm
by Bisonte
infratec wrote:...or it should be mentioned in the help....
It is there in "OpenWindow" ...:
German Help wrote:Auf Windows kann die Breite und Höhe eines Fensters mit Titelzeile nicht kleiner als etwa 100 Pixel sein. Zum Öffnen eines kleineren Fensters verwenden Sie das #PB_Window_BorderLess Flag (rahmenloses Fenster).
Re: Window width is wrong (bug or no bug?)
Posted: Thu Oct 05, 2017 6:57 pm
by infratec
Hi, hi,
but I don't want a borderless window.
And it is not the truth as you can see at my example.
Tested with 60 pixels and it works.
Re: Window width is wrong (bug or no bug?)
Posted: Thu Oct 05, 2017 8:56 pm
by RASHAD
No bug
This is a Windows limitation with #PB_Window_SystemMenu(icon+title+Control buttons[at least close button])
Try #PB_Window_Tool instead to see the difference