void UpdateMenu() { // // Clear out the old list // foreach (Gtk.MenuItem old_item in menu.Children) { menu.Remove(old_item); } // // Build a new list // foreach (BacklinkMenuItem item in GetBacklinkMenuItems()) { item.ShowAll(); menu.Append(item); } // If nothing was found, add in a "dummy" item if (menu.Children.Length == 0) { Gtk.MenuItem blank_item = new Gtk.MenuItem(Catalog.GetString("(none)")); blank_item.Sensitive = false; blank_item.ShowAll(); menu.Append(blank_item); } submenu_built = true; }
void AddCreateItemLabel() { HideSpacerItem(); Gtk.Label emptyLabel = new Gtk.Label(); emptyLabel.Xalign = 0; emptyLabel.Markup = "<i><span foreground='darkgrey'>" + Catalog.GetString("Click to create menu") + "</span></i>"; Gtk.MenuItem mit = new Gtk.MenuItem(); mit.Child = emptyLabel; mit.ButtonPressEvent += OnNewItemPress; Insert(mit, -1); mit.ShowAll(); addLabel = mit; }
void UpdateMenu() { // // Clear out the old list // foreach (Gtk.MenuItem old_item in menu.Children) { menu.Remove(old_item); } Tasque.RemoteControl tasque = GetTasqueRemoteControl(); string [] taskCategories = null; if (tasque != null) { try { taskCategories = tasque.GetCategoryNames(); } catch (Exception e) { Logger.Debug("Exception calling Tasque.GetCategoryNames (): {0}", e.Message); } } if (taskCategories != null) { // // Build a new list // foreach (string category in taskCategories) { CategoryMenuItem item = new CategoryMenuItem(category); item.Activated += OnCategoryActivated; item.ShowAll(); menu.Append(item); } } // If nothing was found, add in a "dummy" item if (menu.Children.Length == 0) { Gtk.MenuItem blankItem = new Gtk.MenuItem(Catalog.GetString("--- Tasque is not running ---")); blankItem.Sensitive = false; blankItem.ShowAll(); menu.Append(blankItem); } submenuBuilt = true; }
public MenuItemBackend(Gtk.MenuItem item) { this.item = item; label = (Gtk.Label) item.Child; item.ShowAll (); }
public MenuItemBackend(Gtk.MenuItem item) { this.item = item; label = (Gtk.Label)item.Child; item.ShowAll(); }
void AddCreateItemLabel() { HideSpacerItem (); Gtk.Label emptyLabel = new Gtk.Label (); emptyLabel.Xalign = 0; emptyLabel.Markup = "<i><span foreground='darkgrey'>" + Catalog.GetString ("Click to create menu") + "</span></i>"; Gtk.MenuItem mit = new Gtk.MenuItem (); mit.Child = emptyLabel; mit.ButtonPressEvent += OnNewItemPress; Insert (mit, -1); mit.ShowAll (); addLabel = mit; }
void UpdateMenu () { // // Clear out the old list // foreach (Gtk.MenuItem old_item in menu.Children) { menu.Remove (old_item); } Tasque.RemoteControl tasque = GetTasqueRemoteControl (); string [] taskCategories = null; if (tasque != null) { try { taskCategories = tasque.GetCategoryNames (); } catch (Exception e) { Logger.Debug ("Exception calling Tasque.GetCategoryNames (): {0}", e.Message); } } if (taskCategories != null) { // // Build a new list // foreach (string category in taskCategories) { CategoryMenuItem item = new CategoryMenuItem (category); item.Activated += OnCategoryActivated; item.ShowAll (); menu.Append (item); } } // If nothing was found, add in a "dummy" item if (menu.Children.Length == 0) { Gtk.MenuItem blankItem = new Gtk.MenuItem (Catalog.GetString ("--- Tasque is not running ---")); blankItem.Sensitive = false; blankItem.ShowAll (); menu.Append (blankItem); } submenuBuilt = true; }
void UpdateMenu () { // // Clear out the old list // foreach (Gtk.MenuItem old_item in menu.Children) { menu.Remove (old_item); } // // Build a new list // foreach (BacklinkMenuItem item in GetBacklinkMenuItems ()) { item.ShowAll (); menu.Append (item); } // If nothing was found, add in a "dummy" item if (menu.Children.Length == 0) { // This is a disabled placeholder item for an empty menu Gtk.MenuItem blank_item = new Gtk.MenuItem (Catalog.GetString ("(none)")); blank_item.Sensitive = false; blank_item.ShowAll (); menu.Append (blank_item); } submenu_built = true; }
public MenuItemBackend() { item = new Gtk.ImageMenuItem(""); label = (Gtk.Label)item.Child; item.ShowAll(); }
public MenuItemBackend() { item = new Gtk.ImageMenuItem (""); label = (Gtk.Label) item.Child; item.ShowAll (); }