gui.forceComponentUpdate

Force the update/refresh of an editor GUI component.

Prototype

  1. 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

  1. function onStageViewMenuViewportChanged ( hView, hComponent )
  2.  
  3. local hRenderViewLayout = gui.getComponent ( "RenderViewLayout" )
  4. local hRenderView = gui.getComponent ( "RenderView" )
  5. if ( hRenderViewLayout and hRenderView )
  6. then
  7. local sSenderID = gui.getComponentIdentifier ( hComponent )
  8.  
  9. if ( sSenderID == "mainMenu.display.viewport.fullsize" ) then gui.setDisplayLayoutSize ( hRenderViewLayout, gui.kDisplayLayoutFullSize )
  10. elseif ( sSenderID == "mainMenu.display.viewport.ratio.43" ) then gui.setDisplayLayoutSize ( hRenderViewLayout, gui.kDisplayLayoutRatio4By3 )
  11. elseif ( sSenderID == "mainMenu.display.viewport.ratio.169" ) then gui.setDisplayLayoutSize ( hRenderViewLayout, gui.kDisplayLayoutRatio16By9 )
  12. end
  13.  
  14. onStageViewUpdateMenuDisplay ( gui.getViewFromComponent ( hRenderView ) )
  15. gui.forceComponentUpdate ( hRenderView )
  16. end
  17. end

Available since ShiVa 2.0