public static Gtk.CheckMenuItem CreateAcceleratedMenuItem(this Gtk.ToggleAction action, Gdk.Key key, Gdk.ModifierType mods) { CheckMenuItem item = (CheckMenuItem)action.CreateMenuItem(); (item.Child as AccelLabel).AccelWidget = item; item.AddAccelerator("activate", PintaCore.Actions.AccelGroup, new AccelKey(key, mods, AccelFlags.Visible)); return(item); }
public static Gtk.ToggleAction AppendToggleAction(this Menu menu, string actionName, string actionLabel, string actionTooltip, string actionIcon) { Gtk.ToggleAction action = new Gtk.ToggleAction(actionName, actionLabel, actionTooltip, actionIcon); menu.AppendItem((MenuItem)action.CreateMenuItem()); return(action); }
public Menu BuildLocationlMenu() { Menu etMenu = new Menu(); Gtk.Action home_action = new Gtk.Action("Home", Catalog.GetString("Home")); etMenu.Append(home_action.CreateMenuItem()); home_action.Activated += HandleHome_actionActivated; int iCount = 0; foreach (Location loc in m_locations.Values) { Gtk.Action action = new Gtk.Action(loc.Name, loc.Name); etMenu.Append(action.CreateMenuItem()); action.Activated += HandleActionActivated; iCount ++; } etMenu.Append(new MenuItem()); gpsdAction = new ToggleAction("UseGPSD", Catalog.GetString("GPSD Position"),null, null); //gpsdAction.Active = UIMonitor.getInstance().Configuration.UseGPSD; gpsdAction.Toggled += HandleGpsdActionToggled; etMenu.Append(gpsdAction.CreateMenuItem()); etMenu.ShowAll(); return etMenu; }
public static Gtk.ToggleAction AppendToggleAction(this Menu menu, string actionName, string actionLabel, string actionTooltip, string actionIcon) { Gtk.ToggleAction action = new Gtk.ToggleAction (actionName, actionLabel, actionTooltip, actionIcon); menu.AppendItem ((MenuItem)action.CreateMenuItem ()); return action; }