Author: mhabersack
Date: 2007-06-25 13:54:06 -0400 (Mon, 25 Jun 2007)
New Revision: 80704
Modified:
trunk/moon/desklet/panel/ChangeLog
trunk/moon/desklet/panel/Panel.cs
trunk/moon/desklet/panel/PanelWindow.cs
Log:
2007-06-25 Marek Habersack <[EMAIL PROTECTED]>
* PanelWindow.cs: added a handler for the icon popup menu.
Modified: trunk/moon/desklet/panel/ChangeLog
===================================================================
--- trunk/moon/desklet/panel/ChangeLog 2007-06-25 17:47:48 UTC (rev 80703)
+++ trunk/moon/desklet/panel/ChangeLog 2007-06-25 17:54:06 UTC (rev 80704)
@@ -1,5 +1,7 @@
2007-06-25 Marek Habersack <[EMAIL PROTECTED]>
+ * PanelWindow.cs: added a handler for the icon popup menu.
+
* Panel.cs: added status icon. Graphics is loaded from resources
2007-06-25 Everaldo Canuto <[EMAIL PROTECTED]>
Modified: trunk/moon/desklet/panel/Panel.cs
===================================================================
--- trunk/moon/desklet/panel/Panel.cs 2007-06-25 17:47:48 UTC (rev 80703)
+++ trunk/moon/desklet/panel/Panel.cs 2007-06-25 17:54:06 UTC (rev 80704)
@@ -21,18 +21,17 @@
{
static StatusIcon statusIcon;
- static void SetUpStatusIcon ()
+ static StatusIcon SetUpStatusIcon ()
{
Pixbuf icon = Pixbuf.LoadFromResource
("mono_monkey_icon.png");
- statusIcon = new StatusIcon (icon);
+ return new StatusIcon (icon);
}
public static void Main (string[] args)
{
Application.Init ();
- PanelWindow win = new PanelWindow ();
+ PanelWindow win = new PanelWindow (SetUpStatusIcon ());
win.Show ();
- SetUpStatusIcon ();
Application.Run ();
}
}
Modified: trunk/moon/desklet/panel/PanelWindow.cs
===================================================================
--- trunk/moon/desklet/panel/PanelWindow.cs 2007-06-25 17:47:48 UTC (rev
80703)
+++ trunk/moon/desklet/panel/PanelWindow.cs 2007-06-25 17:54:06 UTC (rev
80704)
@@ -14,11 +14,30 @@
using Gtk;
public partial class PanelWindow: Gtk.Window
-{
+{
+ StatusIcon statusIcon;
+
public PanelWindow (): base (Gtk.WindowType.Toplevel)
{
Build ();
}
+
+ public PanelWindow (StatusIcon statusIcon) : this ()
+ {
+ this.statusIcon = statusIcon;
+ this.statusIcon.PopupMenu += new PopupMenuHandler
(IconPopupHandler);
+ }
+
+ void IconPopupHandler (object o, PopupMenuArgs args)
+ {
+ Menu popup = new Menu ();
+
+ MenuItem item = new MenuItem ("About");
+ popup.Append (item);
+ // broken
+// popup.Popup (null, null, new MenuPositionFunc
(StatusIcon.PositionMenu),
+// null, args.Event.Button,
Gtk.Global.CurrentEventTime);
+ }
protected void OnDeleteEvent (object sender, DeleteEventArgs a)
{
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches