glade-sharpGtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.GLib.ObjectAllows 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);
}
}
Constructor
a Protected Constructor.Chain to this constructor if you have manually registered a native value for your subclass.System.ObsoleteConstructor
Pointer to the C object.
Internal constructorThis is an internal constructor, and should not be used by user code.Constructor
a
a Creates an Glade.XML object from a resource and root object.This is a convenience overload for with the 1st and 4th arguments being .Constructor
a
the widget node to start building from, or .
the translation domain for the XML file
( is the default)
Creates an object from a
Constructor
the filename
the widget node to start building from, or .
the translation domain for the XML file
( is the default)
Creates an from a file Constructor
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)
Creates an object from an
Constructor
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)
Creates an object from a bufferMethodSystem.Void
an with handler methods
Automatically connect signals
Connects the signals definied in the glade file with static handler methods provided by the given object, .
MethodSystem.Void
a with handler methods
Automatically connect signals
Connects the signals defined in the glade file with static handler methods provided by the given ,
.
MethodSystem.Void
The object whose fields are to be bound to the object 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.MethodSystem.Void
an object of type To be addedMethodGtk.Widget
the structure for the widget.
This function is not intended for people who just use
libglade.
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.
MethodSystem.Boolean
the XML filename
the root widget node, or
the translation domain, or
This routine can be used by bindings (such as gtk--) to help
construct a object, if it is
needed.
if construction succeededMethodSystem.Boolean
XML buffer.
buffer size.
root name.
domain.
Constructs an instance from a buffer.boolean representing success.PropertyGlade.XMLCustomWidgetHandlerAllows 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
MethodGtk.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 PropertySystem.Stringthe filename of the objectthe filename that this Glade XML object is created fromMethodGlade.XML
a
a
a Returns a new from a resource in the current assembly.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 formatMethodGlade.XML
a
a
a
a Returns a new from a resource in an assembly.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 formatMethodGlade.XML
a
a
a Creates a new from a stream.a Reads the contents of the stream and parses it. It must be in correct Glade formatMethodGtk.Widget
the name of the widget to retrieve from the xml file
Retrieves a widget stored in the by name
the widget specified by or
if no Widgets of that name exists
MethodSystem.String
a built from Glade
Gets the name of a Glade-built widgetthe name of the MethodGtk.Widget[]
The beginning of a widget name.
Retrieves a of widgets whose name share the same prefix.An array of widgets whose name starts with .MethodGlade.XML
a Get the parent widget
the object that built , or if is not built from Glade
PropertyGLib.GTypeGType Property.a Returns the native value for .MethodSystem.Void
the parent widget
the structure for the child
This function is intended to be called by the build_children
callback for container widgets.
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.
MethodSystem.Void
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.
Used to set properties on s
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.
PropertyGtk.Widget
To be added.
To be added.To be added.To be added.MethodSystem.String
a filename
This function resolves a relative pathname, using the
directory of the XML file as a base.
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.
MethodSystem.Void
the widget to set parameters on
the structure for
Sets the common parameters on a widget, and is responsible for
inserting it into the object's internal structures.
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.
MethodSystem.Void
the custom widget handler
Deprecated: Replaced by the property.Deprecated: Replaced by the property.System.Obsolete("Replaced by CustomHandler property.")MethodSystem.Void
the container widget.
the contained child
the name of the property
its stringified value
This sets the packing property on container of widget with
to MethodSystem.Boolean
a " />
a
a GParamSpec needs to be wrappeda MethodSystem.VoidAutomatically 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.
MethodSystem.Void
the function used to connect the signals.
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.
MethodSystem.Void
the name of the signal handler that we want to connect.
the function to use to connect the signals.
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.
PropertyGtk.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.