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


C# Gtk.Add方法代码示例

本文整理汇总了C#中Gtk.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.Add方法的具体用法?C# Gtk.Add怎么用?C# Gtk.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk的用法示例。


在下文中一共展示了Gtk.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Replace

		public void Replace (Gtk.Bin parent)
		{
			Gtk.Widget c = parent.Child;
			parent.Remove (c);
			Add (c);
			parent.Add (this);
		}
开发者ID:wanglehui,项目名称:mono-addins,代码行数:7,代码来源:HeaderBox.cs

示例2: AddImageMenuButton

        public static ImageMenuItem AddImageMenuButton(string title, string imgName, Gtk.Menu parent,EventHandler OnMenuClicked)
        {
            var sep = System.IO.Path.DirectorySeparatorChar;
            var menuItem = new ImageMenuItem(title);

            if (imgName != null)
            {
                var picFileName = SupportMethods.AppPath + sep + "Icons" + sep + imgName;
                if (System.IO.File.Exists(picFileName))
                {
                    menuItem.Image = new Gtk.Image(picFileName);
                }
            }

            if (OnMenuClicked != null)
            {
                menuItem.Activated+= OnMenuClicked;
            }

            if (parent != null)
            {
                parent.Add(menuItem);
            }

            return menuItem;
        }
开发者ID:petrj,项目名称:MediaConvertGUI,代码行数:26,代码来源:Dialogs.cs

示例3: ConnectTextTagTable

    protected void ConnectTextTagTable (Gtk.TextTagTable table, Monotalk.SourceView.Style [] styles)
    {
	foreach (Monotalk.SourceView.Style s in styles)
	{
            Gtk.TextTag tag = new TextTag(s.path);
            tag.Foreground  = s.color;

            table.Add ( tag );
	}
    }
开发者ID:emtees,项目名称:old-code,代码行数:10,代码来源:DemoApp.cs

示例4: Show

		public static Gtk.Window Show (Gtk.Window parent)
		{
			
			Gtk.Builder builder = new Gtk.Builder (null, "Mono.Addins.GuiGtk3.interfaces.AddinManagerDialog.ui", null);
			AddinManagerDialog dlg = new AddinManagerDialog (builder, builder.GetObject ("AddinManagerDialog").Handle);
			InitDialog (dlg);
			parent.Add (dlg);
			dlg.Show ();
			return dlg;
		}
开发者ID:wanglehui,项目名称:mono-addins,代码行数:10,代码来源:AddinManagerWindow.cs

示例5: AuthoringPaneView

        public AuthoringPaneView(Gtk.VBox parent, Project project)
        {
            Project = project;
            active_item = -1;
            DragDataReceived += new DragDataReceivedHandler (HandleTargetDragDataReceived);

            EventBox eb = new EventBox (); // Provides a window for this windowless widget
            parent.Add (eb);

            eb.Add (this);
            Gtk.Drag.DestSet (this, DestDefaults.All, tag_dest_target_table,
                      DragAction.Copy | DragAction.Move);

            eb.ButtonPressEvent += HandleButtonPress;
            eb.ButtonReleaseEvent += HandleButtonRelease;
            eb.MotionNotifyEvent += HandleMotionNotify;

            UpdateTheme ();
        }
开发者ID:GNOME,项目名称:mistelix,代码行数:19,代码来源:AuthoringPaneView.cs

示例6: PopulateFixes

		public void PopulateFixes (Gtk.Menu menu, ref int items)
		{
			int mnemonic = 1;
			bool gotImportantFix = false, addedSeparator = false;
			var fixesAdded = new List<string> ();
			foreach (var fix_ in fixes.OrderByDescending (i => Tuple.Create (IsAnalysisOrErrorFix(i), (int)i.Severity, GetUsage (i.IdString)))) {
				// filter out code actions that are already resolutions of a code issue
				if (fixesAdded.Any (f => fix_.IdString.IndexOf (f, StringComparison.Ordinal) >= 0))
					continue;
				fixesAdded.Add (fix_.IdString);
				if (IsAnalysisOrErrorFix (fix_))
					gotImportantFix = true;
				if (!addedSeparator && gotImportantFix && !IsAnalysisOrErrorFix(fix_)) {
					menu.Add (new Gtk.SeparatorMenuItem ());
					addedSeparator = true;
				}

				var fix = fix_;
				var escapedLabel = fix.Title.Replace ("_", "__");
				var label = (mnemonic <= 10)
					? "_" + (mnemonic++ % 10).ToString () + " " + escapedLabel
						: "  " + escapedLabel;
				var thisInstanceMenuItem = new Gtk.MenuItem (label);
				thisInstanceMenuItem.Activated += new ContextActionRunner (fix, document, loc).Run;
				thisInstanceMenuItem.Activated += delegate {
					ConfirmUsage (fix.IdString);
					menu.Destroy ();
				};
				menu.Add (thisInstanceMenuItem);
				items++;
			}

			bool first = true;
			var alreadyInserted = new HashSet<BaseCodeIssueProvider> ();
			foreach (var analysisFix_ in fixes.OfType <AnalysisContextActionProvider.AnalysisCodeAction>().Where (f => f.Result is InspectorResults)) {
				var analysisFix = analysisFix_;
				var ir = analysisFix.Result as InspectorResults;
				if (ir == null)
					continue;
			
				if (first) {
					menu.Add (new Gtk.SeparatorMenuItem ());
					first = false;
				}
				if (alreadyInserted.Contains (ir.Inspector))
					continue;
				alreadyInserted.Add (ir.Inspector);

				var subMenu = new Gtk.Menu ();
				if (analysisFix.SupportsBatchRunning) {
					var batchRunMenuItem = new Gtk.MenuItem (GettextCatalog.GetString ("Fix all in this file"));
					batchRunMenuItem.Activated += delegate {
						ConfirmUsage (analysisFix.IdString);
						menu.Destroy ();
					};
					batchRunMenuItem.Activated += new ContextActionRunner (analysisFix, document, loc).BatchRun;
					subMenu.Add (batchRunMenuItem);
					subMenu.Add (new Gtk.SeparatorMenuItem ());
				}

				var inspector = ir.Inspector;
				if (inspector.CanSuppressWithAttribute) {
					var menuItem = new Gtk.MenuItem (GettextCatalog.GetString ("_Suppress with attribute"));
					menuItem.Activated += delegate {
						inspector.SuppressWithAttribute (document, analysisFix.DocumentRegion); 
					};
					subMenu.Add (menuItem);
				}

				if (inspector.CanDisableWithPragma) {
					var menuItem = new Gtk.MenuItem (GettextCatalog.GetString ("_Suppress with #pragma"));
					menuItem.Activated += delegate {
						inspector.DisableWithPragma (document, analysisFix.DocumentRegion); 
					};
					subMenu.Add (menuItem);
				}

				if (inspector.CanDisableOnce) {
					var menuItem = new Gtk.MenuItem (GettextCatalog.GetString ("_Disable once with comment"));
					menuItem.Activated += delegate {
						inspector.DisableOnce (document, analysisFix.DocumentRegion); 
					};
					subMenu.Add (menuItem);
				}

				if (inspector.CanDisableAndRestore) {
					var menuItem = new Gtk.MenuItem (GettextCatalog.GetString ("Disable _and restore with comments"));
					menuItem.Activated += delegate {
						inspector.DisableAndRestore (document, analysisFix.DocumentRegion); 
					};
					subMenu.Add (menuItem);
				}
				var label = GettextCatalog.GetString ("_Options for \"{0}\"", InspectorResults.GetTitle (ir.Inspector));
				var subMenuItem = new Gtk.MenuItem (label);

				var optionsMenuItem = new Gtk.MenuItem (GettextCatalog.GetString ("_Configure inspection"));
				optionsMenuItem.Activated += analysisFix.ShowOptions;
				optionsMenuItem.Activated += delegate {
					menu.Destroy ();
				};
//.........这里部分代码省略.........
开发者ID:pavlos256,项目名称:monodevelop,代码行数:101,代码来源:CodeActionWidget.cs

示例7: AddSortContextMenuButton

 private void AddSortContextMenuButton(Gtk.Menu menu, SongList.SortColumnEnum sortColumn, string title)
 {
     Gtk.MenuItem item = new MenuItem(title);
     item.ButtonPressEvent +=new ButtonPressEventHandler(contextMenu_ButtonPressEvent);
     item.Data["key"] = "sort";
     item.Data["sort"] = sortColumn;
     menu.Add(item);
 }
开发者ID:petrj,项目名称:MP3Tagger,代码行数:8,代码来源:MainWindow.cs

示例8: AddSortContextMenu

    private void AddSortContextMenu(Gtk.Menu menu)
    {
        Gtk.MenuItem sortItem = new MenuItem(Lng.Translate("Sort"));

        menu.Add(sortItem);

        // sort menu

        Gtk.Menu sortMenu = new Menu();

        AddSortContextMenuButton(sortMenu,SongList.SortColumnEnum.FileName,Lng.Translate("FileName"));

        AddSortContextMenuButton(sortMenu,SongList.SortColumnEnum.Title,Lng.Translate("Title"));
        AddSortContextMenuButton(sortMenu,SongList.SortColumnEnum.Artist,Lng.Translate("Artist"));
        AddSortContextMenuButton(sortMenu,SongList.SortColumnEnum.Album,Lng.Translate("Album"));

        AddSortContextMenuButton(sortMenu,SongList.SortColumnEnum.Year,Lng.Translate("Year"));
        AddSortContextMenuButton(sortMenu,SongList.SortColumnEnum.Genre,Lng.Translate("Genre"));
        AddSortContextMenuButton(sortMenu,SongList.SortColumnEnum.Album,Lng.Translate("Comment"));
        AddSortContextMenuButton(sortMenu,SongList.SortColumnEnum.Track,Lng.Translate("TrackNumber"));
        AddSortContextMenuButton(sortMenu,SongList.SortColumnEnum.Changed,Lng.Translate("Changed"));

        sortItem.Submenu = sortMenu;
    }
开发者ID:petrj,项目名称:MP3Tagger,代码行数:24,代码来源:MainWindow.cs

示例9: AddRunContextMenu

    private void AddRunContextMenu(Gtk.Menu menu)
    {
        Gtk.MenuItem runItem = new MenuItem(Lng.Translate("Run"));

        menu.Add(runItem);

        // submenu

        Gtk.Menu runMenu = new Menu();

        foreach (var runApp in Configuration.RunApplications)
        {
            var item = AddContextMenuButton(runMenu,"run",runApp);
            item.Data["runApp"] = runApp;
        }

        runItem.Submenu = runMenu;
    }
开发者ID:petrj,项目名称:MP3Tagger,代码行数:18,代码来源:MainWindow.cs

示例10: AddContextMenuButton

    private Gtk.MenuItem AddContextMenuButton(Gtk.Menu menu, string actionKey, string title)
    {
        Gtk.MenuItem item = new MenuItem(title);
        item.ButtonPressEvent +=new ButtonPressEventHandler(contextMenu_ButtonPressEvent);
        item.Data["key"] = actionKey;
        menu.Add(item);

        return item;
    }
开发者ID:petrj,项目名称:MP3Tagger,代码行数:9,代码来源:MainWindow.cs

示例11: Add

		public static void Add (Gtk.Container aContainer, Widget aWidget)
		{
			if (aWidget == null)
				return;
			if (aContainer == null)
				throw new Exception ("Adding widget to null container");
			aContainer.Add (aWidget);
		}
开发者ID:QualitySolution,项目名称:Gtk.DataBindings,代码行数:8,代码来源:CustomPaintedContainer.cs

示例12: RunInstall

		void RunInstall (Gtk.Alignment commandBox, Update update)
		{
			installing = true;
			
			ProgressBarMonitor monitorBar = new ProgressBarMonitor ();
			monitorBar.ShowErrorsDialog = true;
			monitorBar.Show ();
			commandBox.Child.Destroy ();
			commandBox.Add (monitorBar);
			
			IAsyncOperation oper = update.InstallAction (monitorBar.CreateProgressMonitor ());
			oper.Completed += delegate {
				DispatchService.GuiDispatch (delegate {
					monitorBar.Hide ();
					Gtk.Label result = new Gtk.Label ();
					if (oper.Success)
						result.Text = GettextCatalog.GetString ("Completed");
					else
						result.Text = GettextCatalog.GetString ("Failed");
					commandBox.Child.Destroy ();
					commandBox.Add (result);
					result.Show ();
					installing = false;
					
					if (installQueue.Count > 0)
						installQueue.Dequeue ()();
				});
			};
		}
开发者ID:raufbutt,项目名称:monodevelop-old,代码行数:29,代码来源:UpdateDialog.cs

示例13: InitIE

        public void InitIE(Gtk.Box w)
        {
            wb = new System.Windows.Forms.WebBrowser();
            w.SetSizeRequest(500, 500);
            wb.Height = 500; // w.GdkWindow.FrameExtents.Height;
            wb.Width = 500; // w.GdkWindow.FrameExtents.Width;
            wb.Navigate("about:blank");
            wb.Document.Write(String.Empty);

            socket = new Gtk.Socket();
            socket.SetSizeRequest(wb.Width, wb.Height);
            w.Add(socket);
            socket.Realize();
            socket.Show();
            socket.UnmapEvent += Socket_UnmapEvent;
            IntPtr browser_handle = wb.Handle;
            IntPtr window_handle = (IntPtr)socket.Id;
            SetParent(browser_handle, window_handle);

            /// Another interesting issue is that on Windows, the WebBrowser control by default is
            /// effectively an IE7 browser, and I don't think you can easily change that without
            /// changing registry settings. The lack of JSON parsing in IE7 triggers errors in google maps.
            /// See https://code.google.com/p/gmaps-api-issues/issues/detail?id=9004 for the details.
            /// Including the meta tag of <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
            /// fixes the problem, but we can't do that in the HTML that we set as InnerHtml in the
            /// LoadHTML function, as the meta tag triggers a restart of the browser, so it
            /// just reloads "about:blank", without the new innerHTML, and we get a blank browser.
            /// Hence we set the browser type here.
            /// Another way to get around this problem is to add JSON.Parse support available from
            /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON
            /// into the HTML Script added when loading Google Maps
            /// I am taking the belts-and-braces approach of doing both, primarily because the
            /// meta tag, while probably the technically better" solution, sometimes doesn't work.

            wb.DocumentText = @"<!DOCTYPE html>
                   <html>
                   <head>
                   <meta http-equiv=""X-UA-Compatible"" content=""IE=edge,10""/>
                   </head>
                   </html>";
        }
开发者ID:hol353,项目名称:ApsimX,代码行数:41,代码来源:HTMLView.cs

示例14: GetOutputMenu

    private void GetOutputMenu(ref Gtk.Menu outputMenu)
    {
        MenuItem miC = new MenuItem(MainClass.Languages.Translate("clear"));
        miC.Activated+= delegate {
            OutputConsole.Clear();
        };
        outputMenu.Add(miC);

        MenuItem miS = new MenuItem(MainClass.Languages.Translate("save"));
        miS.Activated+= delegate {
            OutputConsole.Save();
        };
        outputMenu.Add(miS);
    }
开发者ID:moscrif,项目名称:ide,代码行数:14,代码来源:MainWindow.cs

示例15: InsertMode

 private void InsertMode(char item, ref Gtk.Layout vbox, ref int height)
 {
     string de = "unknown mode. Refer to ircd manual (/raw help)";
     cm.Add(item);
     if (channel._Network.Descriptions.ContainsKey(item))
     {
         de = channel._Network.Descriptions[item];
     }
     CheckButton xx = new CheckButton(item.ToString() + " : " + de);
     xx.Active = channel.ChannelMode._Mode.Contains(item.ToString());
     xx.Name = item.ToString();
     options.Add(xx);
     vbox.Add(xx);
     global::Gtk.Layout.LayoutChild w1 = ((global::Gtk.Layout.LayoutChild)(vbox[xx]));
     w1.X = 0;
     w1.Y = height;
     height += 20;
 }
开发者ID:JGunning,项目名称:OpenAIM,代码行数:18,代码来源:ChannelInfo.cs


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