Simple Examples How Create gui-applications

by

 

08 Aug 2005 (Updated )

Another examples how create gui-interface (with nested functions without Guide).

msr
function msr

  fig = openfig('msr.fig');
  handles = guihandles(fig);

  list = {'gui01', 'gui02', 'gui03', 'gui04', 'gui05', 'gui06', ...
    'gui07', 'gui08', 'gui09', 'gui10', 'gui11', 'gui12'};

  titles = { ...
     '3 buttons (PushButton, ToggleButton)', ...
     '3 buttons with more sofisticated CallBack routines', ...
     'dynamic StaticText', ...
     'RadioButtons', ...
     'CheckBoxes', ...
     'ListBox and PopupMenu', ...
     'Edit and Slider', ...
     'uimenu', ...
     'uicontextmenu', ...
     'uicontextmenu with CallBack routines', ...
     'drawing asteriskes (buttondownfcn)', ...
     ['drawing, moving and deleting asteriskes ', ...
      '(windowbuttondownfcn, windowbuttonupfcn, windowbuttonmotionfcn)']};

  set(handles.listbox, 'String', list);
  set(handles.listbox, 'CallBack', @showtitle);
  set(handles.run, 'CallBack', @run);
  set(handles.close, 'CallBack', 'close(gcf)');

  function run(varargin)
    val = get(handles.listbox, 'Value');
    eval(list{val});
  end;

  function showtitle(varargin)
    val = get(handles.listbox, 'Value');
    set(handles.title, 'String', titles{val});
  end;

end

Contact us