MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Manual do Utilizador Página 297

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 330
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 296
GUI with Axes, Menu, and Toolbar
12-19
Note MATLAB automatically passes hUpdateButtonCallback two
arguments,
hObject and eventdata, because the Update push button
component
Callback property, @hUpdateButtonCallback, is defined as a
function handle.
hObject contains the handle of the component that triggered
execution of the callback.
eventdata is reserved for future use. The function
definition line for your callback must account for these two arguments.
Open Menu Item Callback
The hOpenMenuitemCallback function services the Open menu item and the
Open toolbar button . Selecting the menu item or clicking the toolbar button
triggers the execution of this callback function.
function hOpenMenuitemCallback(hObject, eventdata)
% Callback function run when the Open menu item is selected
file = uigetfile('*.m');
if ~isequal(file, 0)
open(file);
end
end
The hOpenMenuitemCallback function first calls the uigetfile function to
open the standard dialog box for retrieving files. This dialog box lists all
M-files. If
uigetfile returns a filename, the function then calls the open
function to open it.
Vista de página 296
1 2 ... 292 293 294 295 296 297 298 299 300 301 302 ... 329 330

Comentários a estes Manuais

Sem comentários