示例#1
0
        private void OnStatusIconPopupMenu(object sender, PopupMenuArgs args)
        {
            PopupMenu menu = new PopupMenu();

            // Append Menu Items
            if (PopupMenu != null)
            {
                PopupMenu(this, menu);
            }

            if (nyFolder.MainWindow != null)
            {
                menu.AddImageItem("Logout", new EventHandler(OnMenuLogout));
            }

            menu.AddSeparator();

            // Show/Hide Login Dialog Check Box
            if (nyFolder.MainWindow != null)
            {
                menu.AddCheckItem("Show/Hide Window",
                                  nyFolder.MainWindow.Visible,
                                  new EventHandler(OnMenuShowHideWin));
            }

            // Show/Hide Login Dialog Check Box
            if (nyFolder.LoginDialog != null)
            {
                menu.AddCheckItem("Show/Hide Dialog",
                                  nyFolder.LoginDialog.Visible,
                                  new EventHandler(OnMenuShowHideWin));
            }

            menu.AddImageItem(Gtk.Stock.Quit, new EventHandler(OnMenuQuit));

            menu.ShowAll();
            menu.Popup();
        }