From 11f70f092e2f7d91cb8f146ad5972b646efecf66 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Fri, 18 Jun 2004 17:57:09 +0000 Subject: [PATCH] Updates from alf82@freemail.gr svn path=/trunk/gtk-sharp/; revision=29905 --- doc/en/Glade/XML.xml | 52 ++++++++++++++++++++++++++++++ doc/en/Pango/FontDescription.xml | 55 ++++++++++++++++---------------- 2 files changed, 80 insertions(+), 27 deletions(-) diff --git a/doc/en/Glade/XML.xml b/doc/en/Glade/XML.xml index 3dc3b6bda..dbad76e01 100644 --- a/doc/en/Glade/XML.xml +++ b/doc/en/Glade/XML.xml @@ -12,6 +12,58 @@ Allows dynamic loading of user interfaces from XML descriptions + +This object represents an `instantiation' of an XML interface description. When one of these objects is created, the XML file is read, and the interface is created. + + +The object can also be used to connect handlers to the named signals in the description. The easiest way to use this feature is to let it automatically connect signal handlers for you. This can be achieved by using the method. + + + searches the specified or for method names matching those defined in the XML interface description file and connects them to the appropriate signals. It also searches for fields having the attached and tries to bind them to widgets of the same name defined in the XML description. + + +The following examples supposes that an XML interface description of a simple application exists in the file "gui.glade". The application consists of a main window ("MyWindow") which contains a button and a text entry ("MyEntry"). The handler for the button clicked signal is named "OnMyButtonClicked" and the handler for the window delete event is named "OnMyWindowDeleteEvent". + + + +using System; +using Gtk; +using Glade; + +public class GladeApp +{ + // declare the widgets you will use from glade + [Glade.WidgetAttribute] + Gtk.Entry MyEntry; + + public static void Main (string[] args) + { + new GladeApp (args); + } + + public GladeApp (string[] args) + { + Application.Init(); + + Glade.XML gxml = new Glade.XML ("gui.glade", "MyWindow", null); + gxml.Autoconnect (this); + Application.Run(); + } + + // Connect the Signals defined in Glade + public void OnMyWindowDeleteEvent (object o, DeleteEventArgs args) + { + Application.Quit (); + args.RetVal = true; + } + + public void OnMyButtonClicked(object o, EventArgs args) + { + Console.WriteLine("In entry: " + MyEntry.Text); + } +} + + diff --git a/doc/en/Pango/FontDescription.xml b/doc/en/Pango/FontDescription.xml index 53449aaa2..5a459dee3 100644 --- a/doc/en/Pango/FontDescription.xml +++ b/doc/en/Pango/FontDescription.xml @@ -10,8 +10,8 @@ Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - To be added - To be added + Represents the description of an ideal font. + This class is used both to list what fonts are available on the system and also for specifying the characteristics of a font to load. GLib.Opaque @@ -34,7 +34,7 @@ Creates a new font description from a string representation. - To be added: an object of type 'string' + The string representation of the font description. The object of type created. The form of the string representation is "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]", where: @@ -76,11 +76,12 @@ Any one of the options may be absent. If FAMILY-LIST is absent, then the family_ - To be added + Determines which better matches the current instance. To be added: an object of type 'Pango.FontDescription' To be added: an object of type 'Pango.FontDescription' - To be added: an object of type 'bool' - To be added + + if new_match is a better match. + Determines if the style attributes of new_match are a closer match for the current instance than old_match, or if old_match is , determines if new_match is a match at all. Approximate matching is done for weight and style; other attributes must match exactly. @@ -106,7 +107,7 @@ Any one of the options may be absent. If FAMILY-LIST is absent, then the family_ - To be added + Merges the fields of a font description into the current instance without copying the field data (shallow copy). To be added: an object of type 'Pango.FontDescription' To be added: an object of type 'bool' To be added @@ -120,9 +121,9 @@ Any one of the options may be absent. If FAMILY-LIST is absent, then the family_ - To be added + Creates a filename representation of a font description. To be added: an object of type 'string' - To be added + The filename created is identical to the result from calling , but with underscores instead of characters that are untypical in filenames, and in lower case only. @@ -136,9 +137,9 @@ Any one of the options may be absent. If FAMILY-LIST is absent, then the family_ - To be added - To be added: an object of type 'Pango.FontDescription' - To be added: an object of type 'bool' + Merges the fields of a font description into the current instance. + The to merge from. + If , replace fields in current instance with the corresponding values from desc_to_merge, even if they are already exist. To be added @@ -181,9 +182,9 @@ Any one of the options may be absent. If FAMILY-LIST is absent, then the family_ - To be added + Unsets some of the fields in the . To be added: an object of type 'Pango.FontMask' - To be added + This merely marks the fields cleared, it does not clear the settings for those fields. To clear a family name set with so that it won't be returned by , you must actually set to . @@ -222,10 +223,10 @@ Any one of the options may be absent. If FAMILY-LIST is absent, then the family_ - To be added + The style of the font. To be added: an object of type 'Pango.Style' To be added: an object of type 'Pango.Style' - To be added + Most fonts will either have a italic style or an oblique style, but not both, and font matching in Pango will match italic specifications with oblique fonts and vice-versa if an exact match is not found. @@ -237,10 +238,10 @@ Any one of the options may be absent. If FAMILY-LIST is absent, then the family_ - To be added + The stretch of the font. To be added: an object of type 'Pango.Stretch' To be added: an object of type 'Pango.Stretch' - To be added + The stretch property specifies how narrow or wide the font should be. @@ -250,7 +251,7 @@ Any one of the options may be absent. If FAMILY-LIST is absent, then the family_ Pango.FontMask - To be added + Determines which fields in the font description have been set. To be added: an object of type 'Pango.FontMask' To be added @@ -264,10 +265,10 @@ Any one of the options may be absent. If FAMILY-LIST is absent, then the family_ - To be added + The size of the font in pango units. To be added: an object of type 'int' To be added: an object of type 'int' - To be added + There are pango units in one device unit - for fonts, font points are the device unit. Therefore, the size of the font in points is / . @@ -279,7 +280,7 @@ Any one of the options may be absent. If FAMILY-LIST is absent, then the family_ - To be added + Sets the family name of the font without copying the string. To be added: an object of type 'string' To be added: an object of type 'string' To be added @@ -294,7 +295,7 @@ Any one of the options may be absent. If FAMILY-LIST is absent, then the family_ - To be added + The variant of the font. To be added: an object of type 'Pango.Variant' To be added: an object of type 'Pango.Variant' To be added @@ -309,10 +310,10 @@ Any one of the options may be absent. If FAMILY-LIST is absent, then the family_ - To be added + The weight (boldness) of the font. To be added: an object of type 'Pango.Weight' To be added: an object of type 'Pango.Weight' - To be added + The weight property specifies how bold or light the font should be. In addition to the values of the enumeration, other intermediate numeric values are possible. @@ -324,10 +325,10 @@ Any one of the options may be absent. If FAMILY-LIST is absent, then the family_ - To be added + The family name of the font. To be added: an object of type 'string' To be added: an object of type 'string' - To be added + The family name represents a family of related font styles, and will resolve to a particular . In some uses of , it is also possible to use a comma separated list of family names for this property.