private void ToolbarButtonClick(Object sender, ToolBarButtonClickEventArgs e)
    {
        switch ((ToolbarButtons)Buttons.IndexOf(e.Button))
        {
        case ToolbarButtons.MOON_ANIMATION:
            controller.StartMoonAnimation();
            break;

        case ToolbarButtons.SUN_ANIMATION:
            controller.StartSunAnimation();
            break;

        case ToolbarButtons.SUN_MOON_ANIMATION:
            controller.StartSunMoonAnimation();
            break;

        case ToolbarButtons.PAUSE:
            controller.TogglePause();
            break;

        case ToolbarButtons.SLOW:
            controller.Slow();
            break;

        case ToolbarButtons.FAST:
            controller.Fast();
            break;

        case ToolbarButtons.RESET:
            controller.Reset();
            break;
        }
    }
    private void CreateToolbar()
    {
        Toolbar toolbar = new Toolbar();

        toolbar.ToolbarStyle = ToolbarStyle.Text;

        System.Action <string, EventHandler> addButton = (text, action) =>
        {
            ToolButton button = new ToolButton(Stock.New);
            button.Label    = text;
            button.Clicked += action;
            toolbar.Insert(button, -1);
        };

        addButton("Moon", (obj, args) => controller.StartMoonAnimation());
        addButton("Sun", (obj, args) => controller.StartSunAnimation());
        addButton("Earth", (obj, args) => controller.StartSunMoonAnimation());
        toolbar.Insert(new SeparatorToolItem(), -1);
        addButton("Pause", (obj, args) => controller.TogglePause());
        addButton("Slow", (obj, args) => controller.Slow());
        addButton("Fast", (obj, args) => controller.Fast());
        toolbar.Insert(new SeparatorToolItem(), -1);
        addButton("Reset", (obj, args) => controller.Reset());

        VBox vbox = new VBox(false, 2);

        vbox.PackStart(toolbar, false, false, 0);
        Add(vbox);
    }