コード例 #1
0
        public PreferencesButton(string label, Preview preview) : base(label)
        {
            Clicked += delegate
            {
                var activeColor   = new Variable <RGB>(preview.Renderer.ActiveColor);
                var inactiveColor = new Variable <RGB>(preview.Renderer.InactiveColor);

                var dialog = new PreferencesDialog(activeColor, inactiveColor);
                dialog.ShowAll();
                var type = dialog.Run();
                if (type == ResponseType.Ok)
                {
                    preview.SetColors(activeColor.Value, inactiveColor.Value);
                }
                dialog.Destroy();
            };
        }
コード例 #2
0
        public PreferencesButton(string label, Preview preview)
            : base(label)
        {
            Clicked += delegate
            {
              var activeColor = new Variable<RGB>(preview.Renderer.ActiveColor);
              var inactiveColor = new Variable<RGB>(preview.Renderer.InactiveColor);

              var dialog = new PreferencesDialog(activeColor, inactiveColor);
              dialog.ShowAll();
              var type = dialog.Run();
              if (type == ResponseType.Ok)
              {
            preview.SetColors(activeColor.Value, inactiveColor.Value);
              }
              dialog.Destroy();
            };
        }