MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Bedienungsanleitung Seite 185

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 330
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 184
Callback Syntax and Arguments
8-13
References in the M-file to the field of the handles structure that contains
the component’s handle. See “The Handles Structure” on page 8-13 for more
information about the
handles structure.
Changing the Callback Property
To rename a particular callback subfunction without changing the Tag
property,
Replace the name string in the callback property with the new name. For
example, if the value of the callback property for a push button in
mygui is
mygui('pushbutton1_Callback',gcbo,[],guidata(gcbo))
the string pushbutton1_Callback is the name of the callback function.
Change the name to the desired name, for example,
closebutton_Callback.
You must update all instances of the callback function name in the M-file.
You must update references in the M-file to the field of the
handles structure
that contains the component's handle. See “The Handles Structure” on
page 8-13 for more information about the
handles structure.
Input Arguments
All callbacks in the GUI M-file have the following input arguments:
hObject — Handle of the object, e.g., the component, for which the callback
was triggered.
eventdata — Reserved for later use.
handles — Structure that contains the handles of all the objects in the
figure. It may also contain application-defined data. See “The Handles
Structure” on page 8-13 for information about this structure.
The Handles Structure
GUIDE creates a handles structure that contains the handles of all the objects
in the figure. For a GUI that contains an edit text, a panel, a pop-up menu, and
a push button, the
handles structure originally looks similar to this. GUIDE
uses each component’s
Tag property to name the structure element for its
handle.
Seitenansicht 184
1 2 ... 180 181 182 183 184 185 186 187 188 189 190 ... 329 330

Kommentare zu diesen Handbüchern

Keine Kommentare