本文整理汇总了C#中Gtk.ActionGroup.GetAction方法的典型用法代码示例。如果您正苦于以下问题:C# ActionGroup.GetAction方法的具体用法?C# ActionGroup.GetAction怎么用?C# ActionGroup.GetAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.ActionGroup
的用法示例。
在下文中一共展示了ActionGroup.GetAction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainWindow
public MainWindow (): base (Gtk.WindowType.Toplevel)
{
// this window
this.Title= "Supos";
this.DeleteEvent += OnDeleteEvent;
// main vbox
mainBox = new VBox(false, 0);
this.Add(mainBox);
// actiongroup and uimanager stuff (menubar)
actgroup = new ActionGroup ("TestActions");
SetUpActionGroup();
uim = new UIManager ();
uim.InsertActionGroup (actgroup, 0);
this.AddAccelGroup(uim.AccelGroup);
SetUpUiManager();
Gtk.Widget menubar = uim.GetWidget("/MenuBar");
mainBox.PackStart(menubar, false, false, 0);
actgroup.GetAction("disconnect").Sensitive=false;
// main panned view
mainPaned = new HPaned();
mainPaned.Sensitive = false;
mainPaned.Name = "toucharea";
mainBox.PackStart(mainPaned, true, true, 0);
// order editing view
orderview = new ViewOrderEdit();
mainPaned.Pack2(orderview, false, false);
// categories product paned view
HPaned hpan2;
hpan2 = new HPaned();
mainPaned.Pack1(hpan2, true, false);
// categories view
catview = new ViewNameIcon();
catview.DataMember="Categories";
catview.SelectionChanged += this.OnCatSelectionChanged;
catview.WidthRequest= 200;
hpan2.Pack1(catview, false, false);
// products view
prodview = new ViewNameIcon();
prodview.DataMember = "Products";
prodview.RowActivated += this.OnProdRowActivated;
prodview.WidthRequest= 400;
hpan2.Pack2(prodview, true, false);
// status bar
Statusbar statusbar;
statusbar = new Statusbar();
mainBox.PackStart(statusbar, false, false, 0);
// clock
Clock clock;
clock = new Clock();
clock.BorderWidth = 6;
statusbar.PackStart(clock, false, false, 0);
// END build interface
this.ApplyViewPreferences(SettingsHandler.Settings.viewSettings);
}
示例2: InstallInterfaceActions
private void InstallInterfaceActions()
{
InterfaceActionService action_service = ServiceManager.Get<InterfaceActionService> ();
lyrics_action_group = new ActionGroup ("Lyrics");
lyrics_action_group.Add (new ActionEntry[] {
new ActionEntry ("LyricsAction", null,
AddinManager.CurrentLocalizer.GetString ("L_yrics"), null,
AddinManager.CurrentLocalizer.GetString ("Manage Lyrics"), null),
new ActionEntry ("FetchLyricsAction", null,
AddinManager.CurrentLocalizer.GetString ("_Download Lyrics"), null,
AddinManager.CurrentLocalizer.GetString ("Download lyrics for all tracks"), OnFetchLyrics)
});
lyrics_action_group.Add (new ToggleActionEntry[] {
new ToggleActionEntry ("ShowLyricsAction", null,
AddinManager.CurrentLocalizer.GetString ("Show Lyrics"), "<control>T",
AddinManager.CurrentLocalizer.GetString ("Show Lyrics in a separate window"), null, false) });
lyrics_action_group.GetAction ("ShowLyricsAction").Activated += OnToggleWindow;
lyrics_action_group.GetAction ("ShowLyricsAction").Sensitive = ServiceManager.PlayerEngine.CurrentTrack != null ? true : false;
action_service.AddActionGroup (lyrics_action_group);
ui_manager_id = action_service.UIManager.AddUiFromResource ("LyricsMenu.xml");
}