3
// Copyright (C) 2008 GNOME Do
5
// This program is free software: you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation, either version 3 of the License, or
8
// (at your option) any later version.
10
// This program is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU General Public License for more details.
15
// You should have received a copy of the GNU General Public License
16
// along with this program. If not, see <http://www.gnu.org/licenses/>.
20
using System.Collections.Generic;
28
using Do.Interface.CairoUtils;
31
using Docky.Utilities;
33
namespace Docky.Interface.Menus
37
public class DockItemMenu : DockPopupMenu
39
IEnumerable<AbstractMenuArgs> current_args;
41
public DockItemMenu() : base ()
45
public override void PopUp (string header, IEnumerable<AbstractMenuArgs> args, int x, int y)
49
foreach (AbstractMenuArgs arg in args) {
50
Container.PackStart (arg.Widget, false, false, 0);
51
arg.Activated += OnButtonClicked;
52
arg.Widget.ShowAll ();
56
base.PopUp (header, args, x, y);
59
void OnButtonClicked (object o, EventArgs args)
64
protected override void OnHidden ()
66
foreach (Gtk.Widget widget in Container.Children)
67
Container.Remove (widget);
69
foreach (AbstractMenuArgs arg in current_args) {
70
arg.Activated -= OnButtonClicked;