classdef app_3_1_1 < matlab.apps.AppBase

  % Properties that correspond to app components
  properties (Access = public)
    UIFigure  matlab.ui.Figure
    OkButton  matlab.ui.control.Button
    Button_3  matlab.ui.control.Button
    Button_2  matlab.ui.control.Button
    Button    matlab.ui.control.Button
  end

  % Callbacks that handle component events
  methods (Access = private)

    % Button pushed function: OkButton
    function OkButtonPushed(app, event)
      delete( app.UIFigure );
    end

    % Button pushed function: Button
    function ButtonPushed(app, event)
      msgbox( "Button 1 gedrückt!" );
    end

    % Button pushed function: Button_2
    function Button_2Pushed(app, event)
      msgbox( "Button 2 gedrückt!" );
    end

    % Button pushed function: Button_3
    function Button_3Pushed(app, event)
      msgbox( "Button 3 gedrückt!" );
    end
  end

  % Component initialization
  methods (Access = private)

    % Create UIFigure and components
    function createComponents(app)

      % Create UIFigure and hide until all components are created
      app.UIFigure = uifigure('Visible', 'off');
      app.UIFigure.Position = [100 100 476 191];
      app.UIFigure.Name = 'MATLAB App';

      % Create Button
      app.Button = uibutton(app.UIFigure, 'push');
      app.Button.ButtonPushedFcn = createCallbackFcn(app, @ButtonPushed, true);
      app.Button.Position = [40 124 100 23];
      app.Button.Text = '1';

      % Create Button_2
      app.Button_2 = uibutton(app.UIFigure, 'push');
      app.Button_2.ButtonPushedFcn = createCallbackFcn(app, @Button_2Pushed, true);
      app.Button_2.Position = [191 123 100 23];
      app.Button_2.Text = '2';

      % Create Button_3
      app.Button_3 = uibutton(app.UIFigure, 'push');
      app.Button_3.ButtonPushedFcn = createCallbackFcn(app, @Button_3Pushed, true);
      app.Button_3.Position = [348 122 100 23];
      app.Button_3.Text = '3';

      % Create OkButton
      app.OkButton = uibutton(app.UIFigure, 'push');
      app.OkButton.ButtonPushedFcn = createCallbackFcn(app, @OkButtonPushed, true);
      app.OkButton.Position = [191 45 100 23];
      app.OkButton.Text = 'Ok';

      % Show the figure after all components are created
      app.UIFigure.Visible = 'on';
    end
  end

  % App creation and deletion
  methods (Access = public)

    % Construct app
    function app = app_3_1_1

      % Create UIFigure and components
      createComponents(app)

      % Register the app with App Designer
      registerApp(app, app.UIFigure)

      if nargout == 0
        clear app
      end
    end

    % Code that executes before app deletion
    function delete(app)

      % Delete UIFigure when app is deleted
      delete(app.UIFigure)
    end
  end
end