MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Guida Utente Pagina 322

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 759
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 321
8 Programming a GUIDE GUI
7 Add the following code to the mswamp control’s active x1_Click callback.
This code programs the ActiveX control to change the circle radius w hen
the user clicks the circle, and updates the label to display the new radius.
hObject.radius = floor(.9*hObject.radius);
hObject.label = ['Radius = ' num2str(hObject.radiu s)];
refresh(handles.figure1);
8 Add the following commands to the end of the opening function,
Mwsamp_OpeningFcn. This code initializes the label w h en you first open
the GUI.
handles.activex1.label = ...
['Radius = ' num2str(handles.ac tivex1.radius)];
Save the code file. Now, when you open the GUI and click the ActiveX control,
the radius of the circle is reduced by 10 percent and the new value of the
radius is displayed. The following figure shows the GUI after clicking the
circle six tim es.
If you click the GUI e nough times, the circle d isappears .
8-54
Vedere la pagina 321
1 2 ... 317 318 319 320 321 322 323 324 325 326 327 ... 758 759

Commenti su questo manuale

Nessun commento