MATLAB Creating Graphical User Interfaces

(ff) #1
function SliderValueChanged(app, event)
latestvalue = event.Value; % Current slider value
app.PressureGauge.Value = latestvalue; % Update gauge
end

To learn more about the event argument for a specific component's callback function,
see the property page for that component. Right-click the component, and select Help on
Selection to open the property page. For a list of property pages for all UI components,
see “Designing Apps in App Designer”.

Searching for Callbacks in Your Code


If your app has a lot of callbacks, you can quickly search and navigate to a specific
callback by typing part of the name in the search bar at the top of the Callbacks tab in
the Code Browser. After you begin typing, the Callbacks pane clears, except for the
callbacks that match your search.

Click a search result to scroll the callback into view. Right-clicking a search result and
selecting Go To places your cursor in the callback function.

Deleting Callbacks


Delete a callback by right-clicking the callback in the Callbacks tab of the Code
Browser and selecting Delete from the context menu.

17 App Programming

Free download pdf