glade-sharp 2.12.0.0 Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. 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); } } GLib.Object System.Reflection.DefaultMember("Item") Method Glade.XML Get the parent widget a the object that built , or if is not built from Glade Method System.String Gets the name of a Glade-built widget a built from Glade the name of the Property Glade.XMLCustomWidgetHandler Allows you to override the default behaviour when a Custom widget is found in an interface. a Setting this property allows you to override the default behaviour when a Custom widget is found in an interface. This could be used by a language binding to call some other function, or to limit what functions can be called to create custom widgets Method System.Void Deprecated: Replaced by the property. the custom widget handler Deprecated: Replaced by the property. Method System.Void To be added an object of type Method System.Void Binds the widgets declared in the Glade interface specification, to argument's suitable fields. These fields should be marked with the attributes. Any signal declared in the interface specification should be connected using (for detailed control of signal connection) or , the mirror image of this method. The object whose fields are to be bound to the object Method System.Void Automatically connect signals a with handler methods Connects the signals defined in the glade file with static handler methods provided by the given , . Method System.Void Automatically connect signals an with handler methods Connects the signals definied in the glade file with static handler methods provided by the given object, . Method System.Void Sets the common parameters on a widget, and is responsible for inserting it into the object's internal structures. the widget to set parameters on the structure for Sets the common parameters on , and is responsible for inserting it into the object's internal structures. It will also add the children to this widget. Usually this function is only called by , but is exposed for difficult cases, such as setting up buttons and the like. Method System.Void This function is intended to be called by the build_children callback for container widgets. the parent widget the structure for the child This function is intended to be called by the build_children callback for container widgets. If the build_children callback encounters a child with the internal-child attribute set, then it should call this function to handle it and then continue on to the next child. Method System.Void Automatically connect signals This method uses gmodule's introspective features to look at the application's symbol table. From here it tries to match the signal handler names given in the interface description with symbols in the application and connects the signals. Method System.Boolean This routine can be used by bindings (such as gtk--) to help construct a object, if it is needed. the XML filename the root widget node, or the translation domain, or if construction succeeded Method Gtk.AccelGroup This function is used to get the current . If there isn't one, a new one is created and bound to the current toplevel window (if a toplevel has been set). the current Method System.Void This sets the packing property on container of widget with to the container widget. the contained child the name of the property its stringified value Method Gtk.Widget This function is not intended for people who just use libglade. the structure for the widget. the newly created widget. This function is not intended for people who just use libglade. Instead it is for people extending it (it is designed to be called in the child build routine defined for the parent widget). It first checks the type of the widget from the class tag, then calls the corresponding widget creation routine. This routine sets up all the settings specific to that type of widget. Then general widget settings are performed on the widget. Then it sets up accelerators for the widget, and extracts any signal information for the widget. Then it checks to see if there are any child widget nodes for this widget, and if so calls the widget's build routine, which will create the children with this function and add them to the widget in the appropriate way. Finally it returns the widget. Method System.String This function resolves a relative pathname, using the directory of the XML file as a base. a filename The absolute filename This function resolves a relative pathname, using the directory of the XML file as a base. If the pathname is absolute, then the original filename is returned. Method System.Void This function is similar to except that it will try to connect all signals in the interface, not just a single named handler. It can be thought of the interpeted language binding version of , except that it does not require gmodule to function correctly. the function used to connect the signals. Method System.Void Used to set properties on s the property the widget to set the property on. the name of the property. the name of the widget used as the value for the property. Some widgets have properties of type . These are represented as the widget name in the glade file. When constructing the interface, the widget specified as the value for a property may not exist yet. Rather than setting the property directly, this function should be used. It will perform the name to conversion, and if the widget is yet to be constructed, defer setting the property until the widget is constructed. Method Gtk.Widget Retrieves a widget stored in the by name the name of the widget to retrieve from the xml file the widget specified by or if no Widgets of that name exists Method System.Boolean GParamSpec needs to be wrapped a " /> a a a Method System.Void This function is similar to , except that it allows you to give an arbitrary function that will be used for actually connecting the signals. This is mainly useful for writers of interpreted language bindings, or applications where you need more control over the signal connection process. the name of the signal handler that we want to connect. the function to use to connect the signals. Constructor Internal constructor Pointer to the C object. This is an internal constructor, and should not be used by user code. Constructor Creates an from a file the filename the widget node to start building from, or . the translation domain for the XML file ( is the default) Constructor Creates an object from a buffer a string containing the content of the glade XML file the length of the widget node to start building from, or . the translation domain for the XML file ( is the default) Property System.String the filename of the object the filename that this Glade XML object is created from Property Gtk.Window This is used while the tree is being built to set the toplevel window that is currently being built. an object of type This is used while the tree is being built to set the toplevel window that is currently being built. It is mainly used to enable 's to be bound to the correct window, but could have other uses. Constructor Creates an object from a a the widget node to start building from, or . the translation domain for the XML file ( is the default) Constructor Creates an object from an an , or to use the current assembly the name of the resource in the widget node to start building from, or . the translation domain for the XML file ( is the default) Method Glade.XML Creates a new from a stream. a a a a Reads the contents of the stream and parses it. It must be in correct Glade format Method Glade.XML Returns a new from a resource in an assembly. a a a a a Reads the contents of the resource in the given assembly and parses it. If the assembly is null, the current assembly will be used. It must be in correct Glade format Method Glade.XML Returns a new from a resource in the current assembly. a a a a Reads the contents of the resource in the current assembly and parses it. If the assembly is null, the current assembly will be used. It must be in correct Glade format Property GLib.GType GType Property. a Returns the native value for . Constructor Protected Constructor. a Chain to this constructor if you have manually registered a native value for your subclass. System.Obsolete Method Gtk.Widget[] Retrieves a of widgets whose name share the same prefix. The beginning of a widget name. An array of widgets whose name starts with . Constructor Creates an Glade.XML object from a resource and root object. a a This is a convenience overload for with the 1st and 4th arguments being . Property Gtk.Widget To be added. To be added. To be added. To be added. Method System.Boolean XML buffer. buffer size. root name. domain. Constructs an instance from a buffer. boolean representing success.