示例#1
0
        void OnCommandCreated(object s, EventArgs args)
        {
            CustomCommandWidget widget = (CustomCommandWidget)s;

            commands.Add(widget.CustomCommand);

            // Add an empty slot to allow adding more commands.
            AddCommandSlot(null);
        }
		void AddCommandSlot (CustomCommand cmd)
		{
			CustomCommandWidget widget = new CustomCommandWidget (entry, cmd, configSelector, supportedTypes);
			vboxCommands.PackStart (widget, false, false, 0);
			widget.CommandCreated += OnCommandCreated;
			widget.CommandRemoved += OnCommandRemoved;
			widget.Show ();
			lastSlot = widget;
		}
示例#3
0
        void OnCommandRemoved(object s, EventArgs args)
        {
            CustomCommandWidget widget = (CustomCommandWidget)s;

            commands.Remove(widget.CustomCommand);
            if (lastSlot != widget)
            {
                vboxCommands.Remove(widget);
            }
        }
示例#4
0
        void AddCommandSlot(CustomCommand cmd)
        {
            CustomCommandWidget widget = new CustomCommandWidget(entry, cmd, configSelector, supportedTypes);

            vboxCommands.PackStart(widget, false, false, 0);
            widget.CommandCreated += OnCommandCreated;
            widget.CommandRemoved += OnCommandRemoved;
            widget.Show();
            lastSlot = widget;
        }