User guide |
(The code for this example can be found here: [ view | edit | run ] )
This example shows how the enable
property can be
used to indicate to users which bits of an interface are currently
relevant. This is particularly useful for preventing unwanted
clicking during long calculations, loading and saving!
fig =figure
( 'Name', 'Enable example', ... 'Position', [100 100 150 250], ... 'MenuBar', 'none', ... 'ToolBar', 'none', ... 'NumberTitle', 'off' ); panel =uiextras.BoxPanel
( 'Parent', fig, 'Title', 'Panel' );
box =uiextras.VButtonBox
( 'Parent', panel );uicontrol
( 'Parent', box, 'String', 'Button 1' );uicontrol
( 'Parent', box, 'String', 'Button 2' );uicontrol
( 'Parent', box, 'String', 'Button 3', 'Enable', 'off' );uicontrol
( 'Parent', box, 'String', 'Button 4' );uicontrol
( 'Parent', box, 'String', 'Button 5', 'Enable', 'off' );uicontrol
( 'Parent', box, 'String', 'Button 6' );
set( panel, 'Enable', 'off' );
set( panel, 'Enable', 'on' );
Enable and Visible | [Top] | Visible example |