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


C# Gtk.Window.SetDefaultSize方法代码示例

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


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

示例1: GlobalSetup

		static void GlobalSetup ()
		{
			if (initedGlobal || setupFail)
				return;
			initedGlobal = true;
			
			//FIXME: should we remove these when finalizing?
			try {
				ApplicationEvents.Quit += delegate (object sender, ApplicationQuitEventArgs e) {
					if (!IdeApp.Exit ())
						e.UserCancelled = true;
					e.Handled = true;
				};
				
				ApplicationEvents.Reopen += delegate (object sender, ApplicationEventArgs e) {
					if (IdeApp.Workbench != null && IdeApp.Workbench.RootWindow != null) {
						IdeApp.Workbench.RootWindow.Deiconify ();
						IdeApp.Workbench.RootWindow.Show ();
						
						// This is a workaround to a GTK+ bug. The HasTopLevelFocus flag is not properly
						// set when the main window is restored. The workaround is to create and quickly
						// destroy a top level window. GTK+ then detects that the top level focus has
						// changed and properly sets HasTopLevelFocus.
						Gtk.Window ww = new Gtk.Window ("");
						ww.Decorated = false;
						ww.SetDefaultSize (0, 0);
						ww.Present ();
						IdeApp.Workbench.RootWindow.Present ();
						GLib.Timeout.Add (1, delegate {
							// Without this small delay, GTK+ crashes when destroying the window
							ww.Destroy ();
							return false;
						});
						e.Handled = true;
					}
				};
				
				ApplicationEvents.OpenDocuments += delegate (object sender, ApplicationDocumentEventArgs e) {
					//OpenFiles may pump the mainloop, but can't do that from an AppleEvent, so use a brief timeout
					GLib.Timeout.Add (10, delegate {
						IdeApp.OpenFiles (e.Documents.Select (doc =>
							new FileOpenInformation (doc.Key, doc.Value, 1, OpenDocumentOptions.Default)));
						return false;
					});
					e.Handled = true;
				};
				
				//if not running inside an app bundle, assume usual MD build layout and load the app icon
				FilePath exePath = System.Reflection.Assembly.GetExecutingAssembly ().Location;
				if (!exePath.ToString ().Contains ("MonoDevelop.app")) {
					var mdSrcMain = exePath.ParentDirectory.ParentDirectory.ParentDirectory;
					var icons = mdSrcMain.Combine ("theme-icons", "Mac", "monodevelop.icns");
					if (File.Exists (icons))
						NSApplication.SharedApplication.ApplicationIconImage = new NSImage (icons);
				}
			} catch (Exception ex) {
				MonoDevelop.Core.LoggingService.LogError ("Could not install app event handlers", ex);
				setupFail = true;
			}
		}
开发者ID:Poiros,项目名称:monodevelop,代码行数:60,代码来源:MacPlatform.cs

示例2: OnButtonMapInWindowClicked

 protected void OnButtonMapInWindowClicked(object sender, EventArgs e)
 {
     if (mapWindow == null)
     {
         toggleButtonHideAddresses.Sensitive = false;
         toggleButtonHideAddresses.Active = false;
         mapWindow = new Gtk.Window("Карта мониторинга автомобилей на маршруте");
         mapWindow.SetDefaultSize(700, 600);
         mapWindow.DeleteEvent += MapWindow_DeleteEvent;
         vboxRight.Remove(gmapWidget);
         mapWindow.Add(gmapWidget);
         mapWindow.Show();
     }
     else
     {
         toggleButtonHideAddresses.Sensitive = true;
         mapWindow.Remove(gmapWidget);
         vboxRight.PackEnd(gmapWidget, true, true, 1);
         gmapWidget.Show();
         mapWindow.Destroy();
         mapWindow = null;
     }
 }
开发者ID:QualitySolution,项目名称:Vodovoz,代码行数:23,代码来源:RouteListTrackDlg.cs


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