MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Guida Utente Pagina 143

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 759
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 142
Add Components to the GUI
The popup’s callback controls its behavior. GUIDE generates this much of
the callback.
function popupm enu1 _Callback(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata re serv ed - to be defi ned in a future ver sion of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hOb ject,'String') returns popupmenu1
% contents as cell array
% contents{get(hObject,'Value')} returns selected ite m
% from popupmen u1
The callbacks’s code adds these statements.
contents = get(hObject, 'Str ing');
selectedText = contents{get(h Obje ct,'Value')};
colormapStatus = [selectedText ' colormap'];
set(handles.textStatus, 'string', colormapStatus);
colormap(selectedText)
The String data is retrieved as a cell array and assigned to contents.The
Value property indexes the member of contents that the user just selected to
6-29
Vedere la pagina 142
1 2 ... 138 139 140 141 142 143 144 145 146 147 148 ... 758 759

Commenti su questo manuale

Nessun commento