MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Podręcznik Użytkownika Strona 143

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 759
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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
Przeglądanie stron 142
1 2 ... 138 139 140 141 142 143 144 145 146 147 148 ... 758 759

Komentarze do niniejszej Instrukcji

Brak uwag