MATLAB Creating Graphical User Interfaces

(ff) #1
Move Tools

You can reorder tools on the toolbar in two ways:


  • Drag a tool to a new position.

  • Select a tool in the toolbar and click one of the arrow buttons below the right side of
    the toolbar.


If a tool has a separator to its left, the separator moves with the tool.

Remove Tools

You can remove tools from the toolbar in three ways:


  • Select a tool and press the Delete key.

  • Select a tool and click the Delete button.

  • Right-click a tool and select Delete from the context menu.


You cannot undo any of these actions.

Edit a Tool’s Properties

You edit the appearance and behavior of the currently selected tool using the Tool
Properties pane, which includes controls for setting the most commonly used tool
properties:


  • CData — The tool’s icon

  • Tag — The internal name for the tool

  • Enable — Whether users can click the tool

  • Separator — A bar to the left of the icon for setting off and grouping tools

  • Clicked Callback — The function called when users click the tool

  • Off Callback (uitoggletool only) — The function called when the tool is put in the off
    state

  • On Callback (uitoggletool only) — The function called when the tool is put in the on
    state


See “Write Callbacks in GUIDE” on page 7-2 for details on programming the tool
callbacks. You can also access these and other properties of the selected tool with the
Property Inspector. To open the Property Inspector, click the More Properties button on
the Tool Properties pane.

6 Lay Out a UI Using GUIDE

Free download pdf