Author: mhabersack
Date: 2007-06-25 14:08:03 -0400 (Mon, 25 Jun 2007)
New Revision: 80709

Modified:
   trunk/moon/desklet/panel/Panel.cs
   trunk/moon/desklet/panel/PanelWindow.cs
Log:
refactoring -moved StatusIcon stuff to PanelWindow


Modified: trunk/moon/desklet/panel/Panel.cs
===================================================================
--- trunk/moon/desklet/panel/Panel.cs   2007-06-25 18:01:40 UTC (rev 80708)
+++ trunk/moon/desklet/panel/Panel.cs   2007-06-25 18:08:03 UTC (rev 80709)
@@ -13,24 +13,15 @@
 using System;
 using System.IO;
 using Gtk;
-using Gdk;
 
 namespace DeskletsPanel
 {
        class MainClass
        {
-               static StatusIcon statusIcon;
-               
-               static StatusIcon SetUpStatusIcon ()
-               {
-                       Pixbuf icon = Pixbuf.LoadFromResource 
("mono_monkey_icon.png");
-                       return new StatusIcon (icon);
-               }
-               
                public static void Main (string[] args)
                {
                        Application.Init ();
-                       PanelWindow win = new PanelWindow (SetUpStatusIcon ());
+                       PanelWindow win = new PanelWindow ();
                        win.Show ();
                        Application.Run ();
                }

Modified: trunk/moon/desklet/panel/PanelWindow.cs
===================================================================
--- trunk/moon/desklet/panel/PanelWindow.cs     2007-06-25 18:01:40 UTC (rev 
80708)
+++ trunk/moon/desklet/panel/PanelWindow.cs     2007-06-25 18:08:03 UTC (rev 
80709)
@@ -12,6 +12,7 @@
 
 using System;
 using Gtk;
+using Gdk;
 
 public partial class PanelWindow: Gtk.Window
 {
@@ -20,12 +21,11 @@
        public PanelWindow (): base (Gtk.WindowType.Toplevel)
        {
                Build ();
-       }
 
-       public PanelWindow (StatusIcon statusIcon) : this ()
-       {
-               this.statusIcon = statusIcon;
-               this.statusIcon.PopupMenu += new PopupMenuHandler 
(IconPopupHandler);
+               Pixbuf icon = Pixbuf.LoadFromResource ("mono_monkey_icon.png");
+               statusIcon = new StatusIcon (icon);
+               statusIcon = statusIcon;
+               statusIcon.PopupMenu += new PopupMenuHandler (IconPopupHandler);
        }
 
        void IconPopupHandler (object o, PopupMenuArgs args)
@@ -35,8 +35,8 @@
                MenuItem item = new MenuItem ("About");
                popup.Append (item);
                // broken
-//             popup.Popup (null, null, new MenuPositionFunc 
(StatusIcon.PositionMenu),
-//                          null, args.Event.Button, 
Gtk.Global.CurrentEventTime);
+//             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

Reply via email to