gui.setComponentUpdatesEnabled

Enables or disables updates on an editor GUI component.

Prototype

  1. bOk = gui.setComponentUpdatesEnabled ( hComponent, bEnable )

Description

It is highly recommended that you disable updates on a component if you plan on running potentially time consuming scripts that affect the component, then reactivate them when you are done.


Parameters

hComponent - valid GUI component handle
bEnable - true to enable, false to disable


Return values

bOk - true on success


Sample

  1. function onMainViewRefreshFileTree ( hTree, sDirectory )
  2.  
  3. if ( hTree ) then
  4.  
  5. -- block for the duration of the refresh
  6. gui.enableTreeFilter ( hTree, false )
  7. gui.enableTreeSort ( hTree, false )
  8. gui.setComponentUpdatesEnabled ( hTree, false )
  9.  
  10. gui.removeAllTreeItems ( hTree )
  11. -- do some new filling operation ....
  12.  
  13. -- reenable after refresh
  14. gui.enableTreeFilter ( hTree, true )
  15. gui.enableTreeSort ( hTree, true )
  16. gui.setComponentUpdatesEnabled ( hTree, true )
  17. onMainViewUpdateStatusBar ( )
  18. end
  19. end

Available since ShiVa 2.0