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

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 759
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 650
Share Data Among a GUI’s Callbacks
Slider Values. In this example, both the slider callback, slide r_c allback,
and the edit text callback,
edittext_callback, retrieve the GUI data
structure
slider which hold previous and current values of the slider. They
then save the v alue,
slider.val to s lide r.previous_val before retrieving
thenewvalueandassigningitto
slider.val. Before returning, each callback
saves the
slider structure to GUI data.
slider = guidata(fh); % Get GUI data.
slider.previous_val = slider.va l;
slider.val = str2double(get(hObject,'String'));
...
guidata(fh,slider) % Save GUI data before returni ng.
Both callbacks use the guidata function to retrieve and save the s lider
structure as GUI data.
13-23
Vista de pagina 650
1 2 ... 646 647 648 649 650 651 652 653 654 655 656 ... 758 759

Comentarios a estos manuales

Sin comentarios