MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Guia do Utilizador Página 143

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 759
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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 página 142
1 2 ... 138 139 140 141 142 143 144 145 146 147 148 ... 758 759

Comentários a estes Manuais

Sem comentários