MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE User Manual Page 192

  • Download
  • Add to my manuals
  • Print
  • Page
    / 500
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 191
6 Lay Out a UI Using GUIDE
6-106
callback in the code file using a combination of the Tag field and the UI file name.
The callback's name does not display in the Callback field of the Menu Editor, but
selecting the menu item does trigger it.
You can also type an unquoted string into the Callback field to serve as a callback. It
can be any valid MATLAB expression or command. For example, the string
set(gca, 'Color', 'y')
sets the current axes background color to yellow. However, the preferred approach to
performing this operation is to place the callback in the UI code file. This avoids the
use of gca, which is not always reliable when several figures or axes exist. Here is a
version of this callback coded as a function in the UI code file:
function axesyellow_Callback(hObject, eventdata, handles)
% hObject handle to axesyellow (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(handles.axes1,'Color','y')
This code sets the background color of the axes with Tag axes1 no matter to what
object the context menu is attached to.
If you enter a callback string in the Menu Editor, it overrides the callback for the item
in the code file, if any has been saved. If you delete a string you have entered in the
Callback field, the callback for the item in the UI code file is executed when the user
selects that item in the UI.
See “Menu Item” on page 8-22 for more information about specifying this field and
for programming menu items. For another example of programming context menus in
GUIDE, see “Synchronized Data Presentations in a GUIDE UI” on page 9-30.
The View button displays the callback, if there is one, in an editor. If you have not yet
saved the UI, GUIDE prompts you to save it.
Open the Property Inspector, where you can change all menu properties except
callbacks, by clicking the More Properties button. For detailed information about
these properties, see Uicontextmenu Properties.
Associate the Context Menu with an Object
1
In the Layout Editor, select the object for which you are defining the context menu.
2
Use the Property Inspector to set this object's UIContextMenu property to the name
of the desired context menu.
Page view 191
1 2 ... 187 188 189 190 191 192 193 194 195 196 197 ... 499 500

Comments to this Manuals

No comments

Energizer CAPW2BODE manuali

Manuali dei proprietari e guide per l'utente per Torce Energizer CAPW2BODE.
We fornisce 1 manuali pdf Energizer CAPW2BODE per scaricare gratuitamente in base al tipo di documento: Scheda Tecnica


Energizer CAPW2BODE Scheda Tecnica (1 pagine)


Marchio: Energizer | Categoria: Flashlights | Dimensione: 0.07 MB |

 




Più prodotti e manuali per Torce Energizer

Modelli Tipo di Documento
SOLRE35BP Scheda Tecnica   Energizer Solar Folding Lantern, 1 pagine
HD33A2ODE Scheda Tecnica   Energizer HD33A2ODE flashlight, 1 pagine
SOLCKCCBP Scheda Tecnica   Energizer Solar Carabiner Crank Light, 1 pagine
CAPR22ODE Scheda Tecnica   Energizer CAPR22ODE flashlight, 1 pagine
ECAP1AAE Scheda Tecnica   Energizer ECAP1AAE flashlight, 1 pagine
CAPG2BODE Scheda Tecnica   Energizer CAPG2BODE flashlight, 1 pagine
631637 Scheda Tecnica   Energizer Pro-Headlight 4 LED, 1 pagine
MILMOS11L Scheda Tecnica   Energizer MILMOS11L flashlight, 1 pagine
FL452WRH Scheda Tecnica   Energizer FL452WRH flashlight, 1 pagine
PLED34AE Scheda Tecnica    Energizer PLED34AE flashlight, 1 pagine
ELMCL11L Scheda Tecnica   Energizer ELMCL11L flashlight, 1 pagine
HD3LMS32E Scheda Tecnica   Energizer 3 LED Micro Sport Headlight, 1 pagine
3151LS Scheda Tecnica   Energizer 3151LS flashlight, 1 pagine
RCL1NM2WR Scheda Tecnica   Energizer RCL1NM2WR flashlight, 1 pagine
KCC2BODBP Scheda Tecnica   Energizer KCC2BODBP flashlight, 1 pagine
WRCLD41E Scheda Tecnica   Energizer WRCLD41E flashlight, 1 pagine
631638 Scheda Tecnica   Energizer Pro-Headlight 7 LED, 1 pagine
625702 Scheda Tecnica   Energizer Hi-Tech LED 2 in 1, 1 pagine
625701 Scheda Tecnica   Energizer Penlight, 1 pagine
632026 Scheda Tecnica   Energizer ENATEX, 1 pagine