MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Guía de usuario Pagina 143

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 759
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de 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
Vista de pagina 142
1 2 ... 138 139 140 141 142 143 144 145 146 147 148 ... 758 759

Comentarios a estos manuales

Sin comentarios