当前位置: 首页>>代码示例>>C#>>正文


C# ActionGroup.GetAction方法代码示例

本文整理汇总了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);
			
		}
开发者ID:hpbaotho,项目名称:supos,代码行数:56,代码来源:MainWindow.cs

示例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");
        }
开发者ID:nailyk,项目名称:banshee-community-extensions,代码行数:27,代码来源:LyricsService.cs


注:本文中的Gtk.ActionGroup.GetAction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。