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


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

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


在下文中一共展示了Gtk.Window.ShowAll方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: Main

        public static void Main(string[] args)
        {
            GLib.Thread.Init ();
            Gtk.Application.Init ();

            ColorMaker maker = new ColorMaker ();

            Gtk.Window window = new Gtk.Window ("Test");
            window.Add (maker);
            window.ShowAll ();

            Gtk.Application.Run ();
        }
开发者ID:jassmith,项目名称:ColorMaker,代码行数:13,代码来源:Main.cs

示例3: SendMessagesOverviewWindow

		public SendMessagesOverviewWindow()
		{
			// Create window
			Gtk.Window window = new Gtk.Window ( "Verzonden Berichten" );
			window.SetSizeRequest (700, 200);

			// Add tree to window
			Gtk.TreeView tree = new Gtk.TreeView ();
			window.Add (tree);

			// Create the column for displaying the telephone number.
			Gtk.TreeViewColumn numberReceiverColumn = new Gtk.TreeViewColumn ();
			numberReceiverColumn.Title = "Telefoon nummer";
			numberReceiverColumn.MinWidth = 200;
			// Create the text cell that will display the telephone number.
			Gtk.CellRendererText numberReceiverCell = new Gtk.CellRendererText ();
			// Add the cell to the column.
			numberReceiverColumn.PackStart (numberReceiverCell, true);

			// Create the column for displaing the message.
			Gtk.TreeViewColumn messageColumn = new Gtk.TreeViewColumn ();
			messageColumn.Title = "Bericht";
			messageColumn.MinWidth = 300;
			// Create the text cell that will display the message.
			Gtk.CellRendererText messageCell = new Gtk.CellRendererText ();
			messageColumn.PackStart (messageCell, true);

			// Create the column for displaying the date send.
			Gtk.TreeViewColumn sendAtColumn = new Gtk.TreeViewColumn ();
			sendAtColumn.Title = "Verstuurd op";
			sendAtColumn.MinWidth = 200;
			// Create the text cell that will display the date send.
			Gtk.CellRendererText sendAtCell = new Gtk.CellRendererText ();
			sendAtColumn.PackStart (sendAtCell, true);

			tree.AppendColumn (numberReceiverColumn);
			tree.AppendColumn (messageColumn);
			tree.AppendColumn (sendAtColumn);

			// Tell the cell renderers which items in the model to display
			numberReceiverColumn.AddAttribute (numberReceiverCell, "text", 0);
			messageColumn.AddAttribute (messageCell, "text", 1);
			sendAtColumn.AddAttribute (sendAtCell, "text", 2);

			// Assign the model to the TreeView
			tree.Model = this.getMessageList ();
			// Show the window and everythin on it.
			window.ShowAll ();
		}
开发者ID:jorisrietveld,项目名称:SmsApp,代码行数:49,代码来源:SendMessagesOverviewWindow.cs

示例4: MusicSource

        public MusicSource()
            : base("Google Music", "Google Music", 30)
        {
            api = new Google.Music.Api();
            downloadWrapper = new MusicDownloadWrapper(api);
            downloadWrapper.Start();

            TypeUniqueId = "google-music";
            Properties.Set<Gdk.Pixbuf>("Icon.Pixbuf_16", Gdk.Pixbuf.LoadFromResource("google-music-favicon"));

            var win = new Gtk.Window("Google Music Login");
            var loginWidget = new LoginWidget();
            loginWidget.UserLoggedIn += (cookies) => {
                api.SetCookies(cookies);
                AsyncUserJob.Create(() => {
                    Refetch();
                }, "Fetching playlist");

                win.Destroy();
            };
            win.Add(loginWidget);
            win.ShowAll();
        }
开发者ID:pontus,项目名称:banshee-googlemusic,代码行数:23,代码来源:MusicSource.cs

示例5: Main

		public static void Main (string [] args)
		{
			Gtk.Application.Init ();
			Gdk.Pixbuf pixbuf = new Gdk.Pixbuf (args [0]);
			Log.DebugFormat ("loaded {0}", args [0]);
			Histogram hist = new Histogram ();
			Log.DebugFormat ("loaded histgram", args [0]);

			Gtk.Window win = new Gtk.Window ("display");
			Gtk.Image image = new Gtk.Image ();
			Gdk.Pixbuf img = hist.Generate (pixbuf);
			image.Pixbuf = img;
			win.Add (image);
			win.ShowAll ();
			Gtk.Application.Run ();

		}
开发者ID:mono,项目名称:f-spot,代码行数:17,代码来源:Histogram.cs

示例6: Main

        public static void Main(string[] args)
        {
            Gtk.Application.Init();

            string method;
            if (args.Length < 1)
                method = "train";
            else
                method = args[0];

            StrongClassifier? classifier;
            if (method == "load")
                classifier = StrongClassifier.LoadFromFile(args[1]);
            else if (method == "train") {
                string trainingDir = args[1];

                classifier = StrongClassifier.Train(trainingDir);

                if (args.Length > 2)
                    classifier.Value.Save(args[2]);
            }

            var win = new Gtk.Window("Détecteur de visages");
            win.DefaultHeight = 350;
            win.DefaultWidth = 400;

            var toolbar = new Gtk.Toolbar();
            var openButton = new Gtk.ToolButton(Gtk.Stock.Open);
            toolbar.Add(openButton);

            var image = new Gtk.Image();

            openButton.Clicked += (sender, eventArgs) => {
                var fileDialog = new Gtk.FileChooserDialog("Choisissez une photo", null, Gtk.FileChooserAction.Open,
                                                           "Open", Gtk.ResponseType.Accept);
                fileDialog.Run();

                var photo = new Gdk.Pixbuf(fileDialog.Filename);
                fileDialog.Destroy();

            //				var photo = new Gdk.Pixbuf("/home/rapha/Bureau/300px-Thief_-_Radiohead.jpg");
            //				var photo = new IntegralImage("/home/rapha/Bureau/The_Beatles_Abbey_Road.jpg").Pixbuf;

                var detector = new Detector(photo, classifier.Value);

                foreach (var rect in detector.Detect()) {
                    rect.Draw(photo);
                    Console.WriteLine(rect);
                }

                image.Pixbuf = photo;
            };

            var vbox = new Gtk.VBox();
            vbox.PackStart(toolbar, false, false, 0);
            vbox.PackStart(image, true, true, 0);

            win.Add(vbox);
            win.ShowAll();

            Gtk.Application.Run();
        }
开发者ID:RaphaelJ,项目名称:Viola-Jones-Mono,代码行数:62,代码来源:Main.cs

示例7: 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

示例8: SlideShow

			public SlideShow (string name)
			{
				Tag tag;
				
				if (name != null)
					tag = Database.Tags.GetTagByName (name);
				else {
					int id = (int) Preferences.Get (Preferences.SCREENSAVER_TAG);
					tag = Database.Tags.GetTagById (id);
				}
				
				Photo [] photos;
				if (tag != null)
					photos = Database.Photos.Query (new Tag [] { tag } );
 				else if ((int) Preferences.Get (Preferences.SCREENSAVER_TAG) == 0)
 					photos = db.Photos.Query (new Tag [] {});
				else
					photos = new Photo [0];

				window = new XScreenSaverSlide ();
				SetStyle (window);
				if (photos.Length > 0) {
					Array.Sort (photos, new Photo.RandomSort ());
					
					Gdk.Pixbuf black = new Gdk.Pixbuf (Gdk.Colorspace.Rgb, false, 8, 1, 1);
					black.Fill (0x00000000);
					slideview = new SlideView (black, photos);
					window.Add (slideview);
				} else {
					Gtk.HBox outer = new Gtk.HBox ();
					Gtk.HBox hbox = new Gtk.HBox ();
					Gtk.VBox vbox = new Gtk.VBox ();

					outer.PackStart (new Gtk.Label (String.Empty));
					outer.PackStart (vbox, false, false, 0);
					vbox.PackStart (new Gtk.Label (String.Empty));
					vbox.PackStart (hbox, false, false, 0);
					hbox.PackStart (new Gtk.Image (Gtk.Stock.DialogWarning, Gtk.IconSize.Dialog),
							false, false, 0);
					outer.PackStart (new Gtk.Label (String.Empty));

					string msg;
					string long_msg;

					if (tag != null) {
						msg = String.Format (Catalog.GetString ("No photos matching {0} found"), tag.Name);
						long_msg = String.Format (Catalog.GetString ("The tag \"{0}\" is not applied to any photos. Try adding\n" +
											     "the tag to some photos or selecting a different tag in the\n" +
											     "F-Spot preference dialog."), tag.Name);
					} else {
						msg = Catalog.GetString ("Search returned no results");
						long_msg = Catalog.GetString ("The tag F-Spot is looking for does not exist. Try\n" + 
									      "selecting a different tag in the F-Spot preference\n" + 
									      "dialog.");
					}

					Gtk.Label label = new Gtk.Label (msg);
					hbox.PackStart (label, false, false, 0);

					Gtk.Label long_label = new Gtk.Label (long_msg);
					long_label.Markup  = String.Format ("<small>{0}</small>", long_msg);

					vbox.PackStart (long_label, false, false, 0);
					vbox.PackStart (new Gtk.Label (String.Empty));

					window.Add (outer);
					SetStyle (label);
					SetStyle (long_label);
					//SetStyle (image);
				}
				window.ShowAll ();
			}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:72,代码来源:Core.cs

示例9: Main

		public static void Main (string [] args) 
		{
			System.Collections.ArrayList failed = new System.Collections.ArrayList ();
			Gtk.Application.Init ();
			foreach (string path in args) {
				Gtk.Window win = new Gtk.Window (path);
				Gtk.HBox box = new Gtk.HBox ();
				box.Spacing = 12;
				win.Add (box);
				Gtk.Image image;
				image = new Gtk.Image ();

				System.DateTime start = System.DateTime.Now;
				System.TimeSpan one = start - start;
				System.TimeSpan two = start - start;
				try {
					start = System.DateTime.Now;
					image.Pixbuf = new Gdk.Pixbuf (path);
					one = System.DateTime.Now - start;
				}  catch (System.Exception e) {
				}
				box.PackStart (image);

				image = new Gtk.Image ();
				try {
					start = System.DateTime.Now;
					PngFile png = new PngFile (path);
					image.Pixbuf = png.GetPixbuf ();
					two = System.DateTime.Now - start;
				} catch (System.Exception e) {
					failed.Add (path);
					//System.Console.WriteLine ("Error loading {0}", path);
					//System.Console.WriteLine (e.ToString ());
				}

				//System.Console.WriteLine ("{2} Load Time {0} vs {1}", one.TotalMilliseconds, two.TotalMilliseconds, path); 
				box.PackStart (image);
				win.ShowAll ();
			}
			
			//System.Console.WriteLine ("{0} Failed to Load", failed.Count);
			foreach (string fail_path in failed) {
				//System.Console.WriteLine (fail_path);
			}

			Gtk.Application.Run ();
		}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:47,代码来源:PngFile.cs


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