From 5b00f6f7584b07f3acbf0826b730d3801754683d Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Fri, 11 Jun 2004 19:09:54 +0000 Subject: [PATCH] Flush svn path=/trunk/gtk-sharp/; revision=29376 --- doc/en/Gdk/Screen.xml | 12 +++++++++++- doc/en/Gtk/Window.xml | 7 +++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/en/Gdk/Screen.xml b/doc/en/Gdk/Screen.xml index 8f814e408..83c78f78e 100644 --- a/doc/en/Gdk/Screen.xml +++ b/doc/en/Gdk/Screen.xml @@ -60,7 +60,17 @@ To be added a - To be added + + Returns an of the number of monitors attached to the current . + The following example will print the number of monitors in the current display to the console. + + Display theDisplay = Display.OpenDefaultLibgtkOnly(); +Screen defaultScreen = theDisplay.DefaultScreen; +int numMonitors = defaultScreen.NMonitors; +Console.WriteLine("You have {0} monitors.",numMonitors); + + + diff --git a/doc/en/Gtk/Window.xml b/doc/en/Gtk/Window.xml index 36baefe2c..459d7c4b6 100644 --- a/doc/en/Gtk/Window.xml +++ b/doc/en/Gtk/Window.xml @@ -162,6 +162,13 @@ Note 1: Nearly any use of this method creates a race condition, because the size of the may change between the time that you get the size and the time that you perform some action assuming that size is the current size. To avoid race conditions, connect to on the and adjust your size-dependent state to match the size delivered in the GdkEventConfigure. + The following example will print the height and width of a called myWindow to the console. + + int height =0; +int width = 0; +myWindow.GetSize(out width , out height); +Console.WriteLine("Width: {0}, Height: {1}" , width , height); +