function GUIkalk(akce)

if nargin < 1
    akce = 'init';
end

switch akce
    case 'init'
        figure('name','GUIkalk','position',[200 200, 200 100]);
        uicontrol('unit','normalized','style','edit',...
                  'position',[0 0.7, 0.5 0.3],'backgroundcolor','w',...
                  'String','0','tag','a');
              
        uicontrol('unit','normalized','style','edit',...
                  'position',[0 0.4, 0.5 0.3],'backgroundcolor','w',...
                  'String','0','tag','b');
              
        uicontrol('unit','normalized','style','pushbutton',...
                  'position',[0, 0, 0.25 0.4],...
                  'String','+','callback','GUIkalk(''plus'')');
              
        uicontrol('unit','normalized','style','pushbutton',...
                  'position',[0.25, 0, 0.25 0.4],...
                  'String','-','callback','GUIkalk(''minus'')');
              
        uicontrol('unit','normalized','style','pushbutton',...
                  'position',[0.5, 0, 0.25 0.4],...
                  'String','*','callback','GUIkalk(''krat'')');
              
        uicontrol('unit','normalized','style','pushbutton',...
                  'position',[0.75, 0, 0.25 0.4],...
                  'String','/','callback','GUIkalk(''deleno'')');
              
        uicontrol('unit','normalized','style','text','fontsize',16,...
                  'position',[0.5, 0.4, 0.5 0.6],...
                  'String','0','tag','vysledek');              

              
    case 'plus'
        a = str2double(get(findobj('tag','a'),'string'));
        b = str2double(get(findobj('tag','b'),'string'));
        c = a + b;
        set(findobj('tag','vysledek'),'string',num2str(c));
        
    case 'minus'
        a = str2double(get(findobj('tag','a'),'string'));
        b = str2double(get(findobj('tag','b'),'string'));
        c = a - b;
        set(findobj('tag','vysledek'),'string',num2str(c));
        
    case 'krat'
        a = str2double(get(findobj('tag','a'),'string'));
        b = str2double(get(findobj('tag','b'),'string'));
        c = a * b;
        set(findobj('tag','vysledek'),'string',num2str(c));
        
    case 'deleno'
        a = str2double(get(findobj('tag','a'),'string'));
        b = str2double(get(findobj('tag','b'),'string'));
        c = a / b;
        set(findobj('tag','vysledek'),'string',num2str(c));
end


