本文整理汇总了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;
}
}
示例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;
}
}