本文整理汇总了C#中Gtk.Window.Resize方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.Window.Resize方法的具体用法?C# Gtk.Window.Resize怎么用?C# Gtk.Window.Resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Window
的用法示例。
在下文中一共展示了Gtk.Window.Resize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NativeWindowFrameHasCorrectScreenBounds
public void NativeWindowFrameHasCorrectScreenBounds ()
{
var nativeWindow = new Gtk.Window ("Foo");
nativeWindow.Resize (450, 320);
nativeWindow.Move (13, 50);
nativeWindow.ShowAll ();
WaitForEvents ();
var window = Toolkit.CurrentEngine.WrapWindow (nativeWindow);
var bounds = window.ScreenBounds;
Assert.AreEqual (450, bounds.Width);
Assert.AreEqual (320, bounds.Height);
Assert.AreEqual (13, bounds.X);
Assert.AreEqual (50, bounds.Y);
nativeWindow.Move (30, 100);
WaitForEvents ();
bounds = window.ScreenBounds;
Assert.AreEqual (30, bounds.X);
Assert.AreEqual (100, bounds.Y);
Assert.AreEqual (450, bounds.Width);
Assert.AreEqual (320, bounds.Height);
nativeWindow.Resize (100, 100);
WaitForEvents ();
bounds = window.ScreenBounds;
Assert.AreEqual (30, bounds.X);
Assert.AreEqual (100, bounds.Y);
Assert.AreEqual (100, bounds.Width);
Assert.AreEqual (100, bounds.Height);
}
示例2: ShowStats
private void ShowStats(string title, int lines, int words,
int chars)
{
Logger.Log ("Wordcount: {0}: {1} {2} {3}", title, lines,
words, chars);
stat_win = new Gtk.Window (String.Format (
"{0} - Word count", title));
stat_win.Resize (200, 100);
Gtk.VBox box = new Gtk.VBox (false, 0);
Gtk.Label stat_label = new Gtk.Label ();
stat_label.Text = String.Format (
"{0}\n\nLines: {1}\nWords: {2}\nCharacters: {3}\n",
title, lines, words, chars);
box.PackStart (stat_label, true, true, 0);
Gtk.Button ok = new Gtk.Button ("Close");
ok.Clicked += new EventHandler (OkHandler);
box.PackStart (ok, true, true, 0);
stat_win.Add (box);
stat_win.ShowAll ();
}