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


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

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

示例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 ();
        }
开发者ID:jhs,项目名称:tomboy-wordcount,代码行数:26,代码来源:WordcountNoteAddin.cs


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