glade-sharp2.6.0.0Gtk# 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.ObjectSystem.Reflection.DefaultMember(MemberName="Item")MethodGlade.XMLGet the parent widget
a
the object that built , or if is not built from Glade
MethodSystem.StringGets the name of a Glade-built widget
a built from Glade
the name of the 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
MethodSystem.VoidDeprecated: Replaced by the property.
the custom widget handler
Deprecated: Replaced by the property.MethodSystem.VoidTo be added
an object of type MethodSystem.VoidBinds 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 MethodSystem.VoidAutomatically connect signals
a with handler methods
Connects the signals defined in the glade file with static handler methods provided by the given ,
.
MethodSystem.VoidAutomatically connect signals
an with handler methods
Connects the signals definied in the glade file with static handler methods provided by the given object, .
MethodSystem.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.
MethodSystem.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.
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.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 succeededMethodGtk.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 MethodSystem.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
MethodGtk.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.
MethodSystem.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.
MethodSystem.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.
MethodSystem.VoidUsed 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.
MethodGtk.Widget
Retrieves a widget stored in the by name
the name of the widget to retrieve
the widget specified by or
if no Widgets of that name exists
MethodSystem.BooleanGParamSpec needs to be wrapped
a " />
a
a a MethodSystem.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.
ConstructorInternal constructor
Pointer to the C object.
This is an internal constructor, and should not be used by user code.ConstructorCreates an from a file
the filename
the widget node to start building from, or .
the translation domain for the XML file
( is the default)
ConstructorCreates 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)
PropertySystem.Stringthe filename of the objectthe filename that this Glade XML object is created fromPropertyGtk.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)
MethodGlade.XMLCreates a new from a stream.
a
a
a a Reads the contents of the stream and parses it. It must be in correct Glade formatMethodGlade.XMLReturns 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 formatMethodGlade.XMLReturns a new from a resource in the current assembly.
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 formatPropertyGLib.GTypeGType Property.a Returns the native value for .ConstructorProtected Constructor.
a Chain to this constructor if you have manually registered a native value for your subclass.System.Obsolete(Message=null, IsError=False)MethodGtk.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 .ConstructorCreates 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 .PropertyGtk.Widget
To be added.
To be added.To be added.To be added.