From bef993d3ccc4b2a462fb5c0872382cb1741fbc3c Mon Sep 17 00:00:00 2001 From: John Luke Date: Fri, 4 Jul 2003 21:36:15 +0000 Subject: [PATCH] en/Gtk/Dialog.xml: fixes en/Gtj/Application.xml: add example, fix methods svn path=/trunk/gtk-sharp/; revision=15947 --- doc/ChangeLog | 7 +++- doc/en/Gtk/Application.xml | 85 +++++++++++++++++++++++++------------- doc/en/Gtk/Dialog.xml | 4 +- 3 files changed, 64 insertions(+), 32 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index f13c3b256..65e196c2b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2003-07-04 John Luke + + * en/Gtk/Dialog.xml: fixes + * en/Gtk/Application.xml: add example, fix methods + 2003-07-04 Duncan Mak * en/Gtk/AccelGroup.xml: revert parts of my last patch, as some of @@ -17,7 +22,7 @@ * en/Gtk/ResponseType.xml: documented. -2003-07-02 John Luke +2003-07-03 John Luke * en/Gtk/Container.xml: add first draft diff --git a/doc/en/Gtk/Application.xml b/doc/en/Gtk/Application.xml index 0fc1819d5..3fd23ed35 100644 --- a/doc/en/Gtk/Application.xml +++ b/doc/en/Gtk/Application.xml @@ -1,5 +1,5 @@ - + gtk-sharp 0.0.0.0 @@ -11,11 +11,38 @@ Provides the initialization and event loop iteration related - methods for the GTK widget library. Since GTK+ is an event + methods for the Gtk# widget library. Since Gtk# is an event driven toolkit, Applications register callbacks against various events to handle user input. These callbacks are invoked from the main event loop when events are detected. + + +using Gtk; +using GtkSharp; +using System; + +public class HelloWorld { + + public static int Main (string[] args) + { + Application.Init (); + Gtk.Window win = new Gtk.Window ("Gtk# Hello World"); + win.DeleteEvent += new DeleteEventHandler (Window_Delete); + win.ShowAll (); + Application.Run (); + return 0; + } + + static void Window_Delete (object obj, DeleteEventArgs args) + { + SignalArgs sa = (SignalArgs) args; + Application.Quit (); + sa.RetVal = true; + } +} + + @@ -52,8 +79,8 @@ Runs a single iteration of the mainloop. If no events are - waiting to be processed GTK+ will block until the next - event is noticed. If you don't want to block look at or check if + waiting to be processed Gtk# will block until the next + event is noticed. If you do not want to block look at or check if any events are pending with first. @@ -68,7 +95,7 @@ Whether there are events on the queue - true if events are available to be processed, false otherwise + if events are available to be processed, otherwise Checks if any events are pending. This can be used to @@ -77,16 +104,16 @@ - void LongComputation () - { - while (!done){ - ComputationChunk (); +void LongComputation () +{ + while (!done){ + ComputationChunk (); - // Flush pending events to keep the GUI reponsive - while (Application.EventsPending ()) - Application.RunIteration (); - } - } + // Flush pending events to keep the GUI reponsive + while (Application.EventsPending ()) + Application.RunIteration (); + } +} @@ -104,7 +131,7 @@ Runs the main loop until is called. You can nest - calls to . In that + calls to . In that case will make the innermost invocation of the main loop return. @@ -121,11 +148,11 @@ - Initializes GTK+ for operation. + Initializes Gtk# for operation. The arguments to pass to the toolkit - Call this function before using any other GTK+ functions + Call this function before using any other Gtk# functions in your GUI applications. It will initialize everything needed to operate the toolkit. @@ -133,7 +160,7 @@ This function will terminate your program if it was unable to initialize the GUI for some reason. If you want your program to fall back to a textual interface you want to - call instead. + call instead. The args values will be modified after Gtk has removed the @@ -152,13 +179,13 @@ - Initializes GTK+ for operation, probes window system. + Initializes Gtk# for operation, probes window system. true if the toolkit was initialized, false if the windowing system can not be initilized. The arguments to pass to the toolkit - You use this call to initialize GTK+ for your GUI + You use this call to initialize Gtk# for your GUI applications. This method will allow your application to be both GUI/text. A true return value means that the toolkit was initialized, a false value means that the @@ -169,7 +196,7 @@ This function will terminate your program if it was unable to initialize the GUI for some reason. If you want your program to fall back to a textual interface you want to - call instead. + call instead. @@ -185,7 +212,7 @@ Initializes GTK+ for operation. - Call this function before using any other GTK+ functions + Call this function before using any other Gtk# functions in your GUI applications. It will initialize everything needed to operate the toolkit. @@ -193,11 +220,11 @@ This function will terminate your program if it was unable to initialize the GUI for some reason. If you want your program to fall back to a textual interface you want to - call instead. + call instead. If you want to pass arguments from the command line use - the + the method instead. @@ -210,16 +237,16 @@ System.Boolean - + A boolean value, whether the iteration should block or not - Runs a single iteration of the mainloop. If is true, then if no events are - waiting to be processed GTK+ will block until the next event is noticed; If is false, - then it if no events are waiting to be processed Gtk+ routine will return immediately. + Runs a single iteration of the mainloop. If is , then if no events are + waiting to be processed Gtk# will block until the next event is noticed; If is , + then it if no events are waiting to be processed Gtk#, routine will return immediately. @@ -232,7 +259,7 @@ To be added - To be added: an object of type 'object' + an object of type To be added diff --git a/doc/en/Gtk/Dialog.xml b/doc/en/Gtk/Dialog.xml index 581aab4af..786e29c8e 100644 --- a/doc/en/Gtk/Dialog.xml +++ b/doc/en/Gtk/Dialog.xml @@ -200,7 +200,7 @@ namespace GtkDialogSample an object of type . an object of type . - Calls for each widget in the with the given response_id. + Sets = for each widget in the with the given response_id. A convenient way to sensitize/desensitize dialog buttons. @@ -346,7 +346,7 @@ namespace GtkDialogSample To be added Emitted when an action widget is clicked, the - receives a delete event, or the application programmer calls . + receives a delete event, or the application programmer calls . On a delete event, the response ID is . Otherwise, it depends on which action widget was clicked.