User guide previous pagenext page

4.1: Setting defaults for one window Go back up one level

The usual use of defaults is to modify the colors, fonts or other settings used for a particular application window. The defaults are therefore changed on the figure object using the uiextras.set function.

The example below sets new defaults for panel title-bar color and font on the window before two panels are added.

f = figure();
uiextras.set( f, 'DefaultHBoxBackgroundColor', [0.3 0.3 0.3] );
uiextras.set( f, 'DefaultBoxPanelTitleColor', 'y' );
uiextras.set( f, 'DefaultBoxPanelFontSize', 16 );
h = uiextras.HBox( 'Parent', f, 'Padding', 10, 'Spacing', 10 );
p1 = uiextras.BoxPanel( 'Parent', h, 'Title', 'Panel 1' );
p2 = uiextras.BoxPanel( 'Parent', h, 'Title', 'Panel 2' );


© 2011 The MathWorks Ltd Terms of Use Patents Trademarks