gui.forceComponentUpdate
Force the update/refresh of an editor GUI component.
Prototype
bOk = gui.forceComponentUpdate ( hComponent, [bImmediate] )
Description
Some components require a refresh after the change of certain settings before the change becomes visible. A canvas size change for the render view is one of such instances, see the example below.
Parameters
hComponent - valid GUI component handle
[bImmediate] - optional immediate flag
Return values
bOk - true on success.
Sample
function onStageViewMenuViewportChanged ( hView, hComponent ) local hRenderViewLayout = gui.getComponent ( "RenderViewLayout" ) local hRenderView = gui.getComponent ( "RenderView" ) if ( hRenderViewLayout and hRenderView ) then local sSenderID = gui.getComponentIdentifier ( hComponent ) if ( sSenderID == "mainMenu.display.viewport.fullsize" ) then gui.setDisplayLayoutSize ( hRenderViewLayout, gui.kDisplayLayoutFullSize ) elseif ( sSenderID == "mainMenu.display.viewport.ratio.43" ) then gui.setDisplayLayoutSize ( hRenderViewLayout, gui.kDisplayLayoutRatio4By3 ) elseif ( sSenderID == "mainMenu.display.viewport.ratio.169" ) then gui.setDisplayLayoutSize ( hRenderViewLayout, gui.kDisplayLayoutRatio16By9 ) end onStageViewUpdateMenuDisplay ( gui.getViewFromComponent ( hRenderView ) ) gui.forceComponentUpdate ( hRenderView ) end end
Available since ShiVa 2.0