MATLAB Creating Graphical User Interfaces

(ff) #1

Panels and Button Groups


Panels and button groups are containers that arrange UI components into groups. If you
move the panel or button group, its children move with it and maintain their positions
relative to the panel or button group.


To define panels and button groups, you must set certain properties. To do this:


(^1) Use the Property Inspector to modify the appropriate properties. Open the Property
Inspector by selecting View > Property Inspector or by clicking the Property
Inspector button.
(^2) In the layout area, select the component you are defining.
Subsequent topics describe commonly used properties of panels and button groups and
offer a simple example for each component.



  • “Commonly Used Properties” on page 6-39

  • “Panel” on page 6-40

  • “Button Group” on page 6-42


Commonly Used Properties


The most commonly used properties needed to describe a panel or button group are
shown in the following table:


Property Values Description
Position 4-element vector: [distance
from left, distance from
bottom, width, height].

Size of the component and
its location relative to its
parent.
Title Character vector (for
example, 'Start').

Component label.

TitlePosition lefttop, centertop,
righttop, leftbottom,
centerbottom,
rightbottom. Default is
lefttop.

Location of title in relation
to the panel or button
group.

Add Components to the GUIDE Layout Area
Free download pdf