![]() |
![]() |
![]() |
Glade UI Builder Reference Manual | ![]() |
---|---|---|---|---|
#include <glade.h> GladeWidgetClass; GladeSignalClass; enum GladeCreateReason; void (*GladePostCreateFunc) (GladeWidgetAdaptor *adaptor, GObject *object, GladeCreateReason reason); void (*GladeChildSetPropertyFunc) (GladeWidgetAdaptor *adaptor, GObject *container, GObject *child, const gchar *property_name, const GValue *value); void (*GladeChildGetPropertyFunc) (GladeWidgetAdaptor *adaptor, GObject *container, GObject *child, const gchar *property_name, GValue *value); GList* (*GladeGetChildrenFunc) (GladeWidgetAdaptor *adaptor, GObject *container); void (*GladeAddChildFunc) (GladeWidgetAdaptor *adaptor, GObject *parent, GObject *child); void (*GladeRemoveChildFunc) (GladeWidgetAdaptor *adaptor, GObject *parent, GObject *child); void (*GladeReplaceChildFunc) (GladeWidgetAdaptor *adaptor, GObject *container, GObject *old_obj, GObject *new_obj); GObject* (*GladeGetInternalFunc) (GladeWidgetAdaptor *adaptor, GObject *parent, const gchar *name); void (*GladeEditorLaunchFunc) (GladeWidgetAdaptor *adaptor, GObject *object);
GladeWidgetClass is a structure based on a GType and parameters from the Glade catalog files and is the central metadata for object classes; it also provides an abstraction later to container apis.
typedef struct { GObjectClass parent_class; void (*add_child) (GladeWidget *, GladeWidget *, gboolean); void (*remove_child) (GladeWidget *, GladeWidget *); void (*replace_child) (GladeWidget *, GObject *, GObject *); void (*add_signal_handler) (GladeWidget *, GladeSignal *); void (*remove_signal_handler) (GladeWidget *, GladeSignal *); void (*change_signal_handler) (GladeWidget *, GladeSignal *, GladeSignal *); gboolean (*action_activated) (GladeWidget *, const gchar *); gint (*button_press_event) (GladeWidget *, GdkEvent *); gint (*button_release_event) (GladeWidget *, GdkEvent *); gint (*motion_notify_event) (GladeWidget *, GdkEvent *); gboolean (*event) (GladeWidget *, GdkEvent *); } GladeWidgetClass;
typedef struct { GSignalQuery query; const gchar *name; /* Name of the signal, eg clicked */ gchar *type; /* Name of the object class that this signal belongs to * eg GtkButton */ } GladeSignalClass;
typedef enum _GladeCreateReason { GLADE_CREATE_USER = 0, GLADE_CREATE_COPY, GLADE_CREATE_LOAD, GLADE_CREATE_REBUILD, GLADE_CREATE_REASONS } GladeCreateReason;
These are the reasons your GladePostCreateFunc can be called.
Was created at the user's request (this is a good time to set any properties or add children to the project; like GtkFrame's label for example). | |
Was created as a result of the copy/paste mechanism, at this point you can count on glade to follow up with properties and children on its own. | |
Was created during the load process. | |
Was created as a replacement for another project object; this only happens when the user is changing a property that is marked by the type system as G_PARAM_SPEC_CONSTRUCT_ONLY. | |
Never used. |
void (*GladePostCreateFunc) (GladeWidgetAdaptor *adaptor, GObject *object, GladeCreateReason reason);
This function is called exactly once for any project object instance and can be for any GladeCreateReason.
|
|
|
a GObject |
|
a GladeCreateReason |
void (*GladeChildSetPropertyFunc) (GladeWidgetAdaptor *adaptor, GObject *container, GObject *child, const gchar *property_name, const GValue *value);
Called to set the packing property property_name
to value
on the child
object of container
.
|
A GladeWidgetAdaptor |
|
The GObject container |
|
The GObject child |
|
The property name |
|
The GValue |
void (*GladeChildGetPropertyFunc) (GladeWidgetAdaptor *adaptor, GObject *container, GObject *child, const gchar *property_name, GValue *value);
Called to get the packing property property_name
on the child
object of container
into value
.
|
A GladeWidgetAdaptor |
|
The GObject container |
|
The GObject child |
|
The property name |
|
The GValue |
GList* (*GladeGetChildrenFunc) (GladeWidgetAdaptor *adaptor, GObject *container);
A function called to get containers
children.
|
|
|
A GObject container |
Returns : |
A GList of GObject children. |
void (*GladeAddChildFunc) (GladeWidgetAdaptor *adaptor, GObject *parent, GObject *child);
Called to add child
to parent
.
|
|
|
A GObject container |
|
A GObject child |
void (*GladeRemoveChildFunc) (GladeWidgetAdaptor *adaptor, GObject *parent, GObject *child);
Called to remove child
from parent
.
|
|
|
A GObject container |
|
A GObject child |
void (*GladeReplaceChildFunc) (GladeWidgetAdaptor *adaptor, GObject *container, GObject *old_obj, GObject *new_obj);
Called to swap placeholders with project objects in containers.
|
|
|
A GObject container |
|
|
|
GObject* (*GladeGetInternalFunc) (GladeWidgetAdaptor *adaptor, GObject *parent, const gchar *name);
Called to lookup child
in composite object parent
by name
.
|
|
|
A GObject composite object |
|
A string identifier |
Returns : |