[Solved] Imperfect results of #pB_Event_SizeDesktop resizing

Just starting out? Need help? Post your questions and find answers here.
es_91
Posts: 36
Joined: Sat Aug 29, 2015 10:25 pm

[Solved] Imperfect results of #pB_Event_SizeDesktop resizing

Post by es_91 »

Please note: This has been solved and is no more a wish/feature request.

Dear Fred,

the common way to place controls on #pB_Window_Background-created frames shows an imperfect handling of resizing notifications when the #pB_Event_SizeDesktop message is used as indicator for browser sizing.

Please see and check the code below:

Code: Select all

enableExplicit



define appTitle$ = "size behaviour"

global background, frame_Main


declare sizeHandler ()


background = openWindow (#pB_Any, #pB_Ignore, #pB_Ignore, #pB_Ignore, #pB_Ignore, appTitle$, #pB_Window_Background )

frame_Main = frameGadget (#pB_Any, 20, 20, windowWidth (background ) - 40, windowHeight (background ) - 40, "frame" )

bindEvent (#pB_Event_SizeDesktop, @ sizeHandler () )



procedure sizeHandler ()
	
	
	resizeGadget (frame_Main, 20, 20, windowWidth (background ) - 40, windowHeight (background ) - 40 )
	
	
endProcedure
Image


The controls do resize, but not every change in browser area size seems to be communicated, as the controls visibly "stuck" in approximate sizes, too lare or too small for the logical measurement imperative.

Workaround/fix ?


----
Test browsers: Opera 50, Chrome, Firefox, iexplore.exe
Last edited by es_91 on Sat Feb 24, 2018 8:00 pm, edited 2 times in total.
:mrgreen:
es_91
Posts: 36
Joined: Sat Aug 29, 2015 10:25 pm

Re: Imperfect results of #pB_Event_SizeDesktop resizing meth

Post by es_91 »

Hoppla!, i found workaround by myself.

The trick is not to use windowWidth and windowHeight for examining the desktop's (browser client size's) measurements but to have examineDesktops and the corresponding size getters do the job.

Easy.

The background window's functions so far return outdated sizes at the moment of obseration (see example above).
:mrgreen:
Post Reply