source: MML/trunk/machine/SOLEIL/common/toolbox/GUILayout/layoutHelp/Examples/visibleexample.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 1.0 KB
Line 
1%% Showing/hiding a panel
2%
3%   This example opens a simple user-interface with a panel full of
4%   buttons. We can then show/hide the entire panel in one go. Note
5%   that the previous state of the buttons is preserved.
6
7%% Open a window and add a panel
8fig = figure( 'Name', 'Visible example', ...
9    'Position', [100 100 150 250], ...
10    'MenuBar', 'none', ...
11    'ToolBar', 'none', ...
12    'NumberTitle', 'off' );
13panel = uiextras.BoxPanel( 'Parent', fig, 'Title', 'Panel' );
14
15%% Put some buttons inside the panel
16box = uiextras.VButtonBox( 'Parent', panel );
17uicontrol( 'Parent', box, 'String', 'Button 1' );
18uicontrol( 'Parent', box, 'String', 'Button 2' );
19uicontrol( 'Parent', box, 'String', 'Button 3', 'Visible', 'off' );
20uicontrol( 'Parent', box, 'String', 'Button 4' );
21uicontrol( 'Parent', box, 'String', 'Button 5', 'Visible', 'off' );
22uicontrol( 'Parent', box, 'String', 'Button 6' );
23
24%% Try disabling the panel
25set( panel, 'Visible', 'off' );
26
27%% Try enabling the panel
28set( panel, 'Visible', 'on' );
Note: See TracBrowser for help on using the repository browser.