## GladeWidget GladeWidget — An object wrapper for the Glade runtime environment. |

## Functions

GladeWidget * | glade_widget_get_from_gobject ()
void | glade_widget_add_child ()
void | glade_widget_remove_child ()
void | glade_widget_replace ()
void | glade_widget_rebuild ()
GladeWidget * | glade_widget_read ()
void | glade_widget_write ()
void | glade_widget_read_child ()
void | glade_widget_write_child ()
void | glade_widget_write_placeholder ()
void | glade_widget_write_special_child_prop ()
GladeEditorProperty * | glade_widget_create_editor_property ()
void | glade_widget_set_child_type_from_node ()
GladeWidget * | glade_widget_dup ()
void | glade_widget_copy_signals ()
void | glade_widget_copy_properties ()
void | glade_widget_set_packing_properties ()
GladeProperty * | glade_widget_get_property ()
GladeProperty * | glade_widget_get_pack_property ()
GList * | glade_widget_dup_properties ()
void | glade_widget_remove_property ()
void | glade_widget_show ()
void | glade_widget_hide ()
void | glade_widget_add_signal_handler ()
void | glade_widget_remove_signal_handler ()
void | glade_widget_change_signal_handler ()
GPtrArray * | glade_widget_list_signal_handlers ()
gboolean | glade_widget_has_decendant ()
gboolean | glade_widget_event ()
gboolean | glade_widget_placeholder_relation ()
GladeWidgetAction * | glade_widget_get_action ()
GladeWidgetAction * | glade_widget_get_pack_action ()
gboolean | glade_widget_set_action_visible ()
gboolean | glade_widget_set_action_sensitive ()
gboolean | glade_widget_set_pack_action_sensitive ()
void | glade_widget_add_prop_ref ()
void | glade_widget_remove_prop_ref ()
void | glade_widget_object_set_property ()
void | glade_widget_object_get_property ()
void | glade_widget_child_set_property ()
void | glade_widget_child_get_property ()
gboolean | glade_widget_property_get ()
gboolean | glade_widget_property_set ()
gboolean | glade_widget_pack_property_get ()
gboolean | glade_widget_pack_property_set ()
gboolean | glade_widget_property_reset ()
gboolean | glade_widget_pack_property_reset ()
gboolean | glade_widget_property_default ()
gboolean | glade_widget_property_original_default ()
gboolean | glade_widget_pack_property_default ()
gboolean | glade_widget_property_set_sensitive ()
gboolean | glade_widget_pack_property_set_sensitive ()
gboolean | glade_widget_property_set_enabled ()
gboolean | glade_widget_pack_property_set_enabled ()
gboolean | glade_widget_property_set_save_always ()
gboolean | glade_widget_pack_property_set_save_always ()
gchar * | glade_widget_property_string ()
gchar * | glade_widget_pack_property_string ()
void | glade_widget_set_name ()
const gchar * | glade_widget_get_name ()
void | glade_widget_set_internal ()
const gchar * | glade_widget_get_internal ()
GObject * | glade_widget_get_object ()
void | glade_widget_set_project ()
GladeProject * | glade_widget_get_project ()
GladeWidgetAdaptor * | glade_widget_get_adaptor ()
GladeWidget * | glade_widget_get_parent ()
void | glade_widget_set_parent ()
gboolean | glade_widget_superuser ()
void | glade_widget_push_superuser ()
void | glade_widget_pop_superuser ()
gboolean | glade_widget_add_verify ()
gboolean | glade_widget_depends ()
void | glade_widget_ensure_name ()
GladeWidget * | glade_widget_find_child ()
gchar * | glade_widget_generate_path_name ()
GList * | glade_widget_get_actions ()
GList * | glade_widget_get_children ()
GdkDevice * | glade_widget_get_device_from_event ()
const gchar * | glade_widget_get_display_name ()
void | glade_widget_set_is_composite ()
gboolean | glade_widget_get_is_composite ()
GladeWidget * | glade_widget_get_locker ()
GList * | glade_widget_get_pack_actions ()
GList * | glade_widget_get_packing_properties ()
GList * | glade_widget_get_parentless_reffed_widgets ()
GladeProperty * | glade_widget_get_parentless_widget_ref ()
GList * | glade_widget_get_properties ()
GList * | glade_widget_get_signal_list ()
GtkTreeModel * | glade_widget_get_signal_model ()
GladeWidget * | glade_widget_get_toplevel ()
gboolean | glade_widget_has_name ()
gboolean | glade_widget_has_prop_refs ()
void | glade_widget_set_in_project ()
gboolean | glade_widget_in_project ()
gboolean | glade_widget_is_ancestor ()
GList * | glade_widget_list_locked_widgets ()
GList * | glade_widget_list_prop_refs ()
void | glade_widget_lock ()
void | glade_widget_unlock ()
gboolean | glade_widget_set_pack_action_visible ()
void | glade_widget_set_support_warning ()
void | glade_widget_support_changed ()
const gchar * | glade_widget_support_warning ()
void | glade_widget_verify ()
void | glade_widget_write_signals ()

## Types and Values

| GladeWidget
#define | GLADE_UNNAMED_PREFIX

## Description

GladeWidget is the proxy between the instantiated runtime object and the Glade core metadata. This api will be mostly usefull for its convenience api for getting and setting properties (mostly from the plugin).

## Functions

### glade_widget_get_from_gobject ()

    GladeWidget *
    glade_widget_get_from_gobject (gpointer object);

#### Parameters

object | A GObject containing the widget |

#### Returns

a GladeWidget.

[transfer none]

### glade_widget_add_child ()

    void
    glade_widget_add_child (GladeWidget *parent,
                            GladeWidget *child,
                            gboolean at_mouse);

Adds `child` to `parent` in a generic way for this GladeWidget parent.

#### Parameters

parent | A GladeWidget |
child | the GladeWidget to add |
at_mouse | whether the added widget should be added at the current mouse position |

### glade_widget_remove_child ()

    void
    glade_widget_remove_child (GladeWidget *parent,
                               GladeWidget *child);

Removes `child` from `parent` in a generic way for this GladeWidget parent.

#### Parameters

parent | A GladeWidget |
child | the GladeWidget to add |

### glade_widget_replace ()

    void
    glade_widget_replace (GladeWidget *parent,
                          GObject *old_object,
                          GObject *new_object);

Replaces a GObject with another GObject inside a GladeWidget which behaves as a container.

Note that both GObjects must be owned by a GladeWidget.

#### Parameters

parent | A GladeWidget |
old_object | a GObject |
new_object | a GObject |

### glade_widget_rebuild ()

    void
    glade_widget_rebuild (GladeWidget *gwidget);

Replaces the current widget instance with a new one while preserving all properties children and takes care of reparenting.

#### Parameters

gwidget | a GladeWidget |

### glade_widget_read ()

    GladeWidget *
    glade_widget_read (GladeProject *project,
                       GladeWidget *parent,
                       GladeXmlNode *node,
                       const gchar *internal);

Creates a new GladeWidget from a XML node.

If node is a template and its parent class is abstract/non instantiatable, Glade will use a class with the GladeInstantiable prefix instead.

For example, with a GtkBin template Glade will GladeInstantiableGtkBin class

#### Parameters

project | a GladeProject |
parent | The parent GladeWidget or `NULL`. | [nullable]
node | a GladeXmlNode |
internal | the name of an internal child name. | [nullable]

#### Returns

a new GladeWidget for `project` , based on `node` .

[transfer full]

### glade_widget_write ()

    void
    glade_widget_write (GladeWidget *widget,
                        GladeXmlContext *context,
                        GladeXmlNode *node);

Recursively writes out `widget` and its children and appends the created GladeXmlNode to `node` .

#### Parameters

widget | The GladeWidget |
context | A GladeXmlContext |
node | A GladeXmlNode |

### glade_widget_read_child ()

    void
    glade_widget_read_child (GladeWidget *widget,
                             GladeXmlNode *node);

Reads in a child widget from the xml (handles 'child' tag)

#### Parameters

widget | A GladeWidget |
node | a GladeXmlNode |

### glade_widget_write_child ()

    void
    glade_widget_write_child (GladeWidget *widget,
                              GladeWidget *child,
                              GladeXmlContext *context,
                              GladeXmlNode *node);

Writes out a widget to the xml, takes care of packing properties and special child types.

#### Parameters

widget | A GladeWidget |
child | The child GladeWidget to write |
context | A GladeXmlContext |
node | A GladeXmlNode |

### glade_widget_write_placeholder ()

    void
    glade_widget_write_placeholder (GladeWidget *parent,
                                    GObject *object,
                                    GladeXmlContext *context,
                                    GladeXmlNode *node);

Writes out a placeholder to the xml

#### Parameters

parent | The parent GladeWidget |
object | A GladePlaceholder |
context | A GladeXmlContext |
node | A GladeXmlNode |

### glade_widget_write_special_child_prop ()

    void
    glade_widget_write_special_child_prop (GladeWidget *parent,
                                           GObject *object,
                                           GladeXmlContext *context,
                                           GladeXmlNode *node);

### glade_widget_create_editor_property ()

    GladeEditorProperty *
    glade_widget_create_editor_property (GladeWidget *widget,
                                         const gchar *property,
                                         gboolean packing,
                                         gboolean use_command);

This is a convenience function to create a GladeEditorProperty corresponding to `property`

#### Parameters

widget | A GladeWidget |
property | The widget's property |
packing | whether `property` indicates a packing property or not. |
use_command | Whether the undo/redo stack applies here. |

#### Returns

A newly created and connected GladeEditorProperty.

[transfer full]

### glade_widget_set_child_type_from_node ()

    void
    glade_widget_set_child_type_from_node (GladeWidget *parent,
                                           GObject *child,
                                           GladeXmlNode *node);

### glade_widget_dup ()

    GladeWidget *
    glade_widget_dup (GladeWidget *template_widget,
                      gboolean exact);

Creates a deep copy of GladeWidget. if `exact` is specified, the widget name is preserved and signals are carried over (this is used to maintain names & signals in Cut/Paste context as opposed to Copy/Paste contexts).

#### Parameters

template_widget | a GladeWidget |
exact | whether or not to creat an exact duplicate |

#### Returns

The newly created GladeWidget.

[transfer full]

### glade_widget_copy_signals ()

    void
    glade_widget_copy_signals (GladeWidget *widget,
                               GladeWidget *template_widget);

Sets signals in `widget` based on the values of matching signals in `template_widget`

#### Parameters

widget | a 'dest' GladeWidget |
template_widget | a 'src' GladeWidget |

### glade_widget_copy_properties ()

    void
    glade_widget_copy_properties (GladeWidget *widget,
                                  GladeWidget *template_widget,
                                  gboolean copy_parentless,
                                  gboolean exact);

Sets properties in `widget` based on the values of matching properties in `template_widget`

#### Parameters

widget | a 'dest' GladeWidget |
template_widget | a 'src' GladeWidget |
copy_parentless | whether to copy reffed widgets at all |
exact | whether to copy reffed widgets exactly |

### glade_widget_set_packing_properties ()

    void
    glade_widget_set_packing_properties (GladeWidget *widget,
                                         GladeWidget *container);

Generates the packing_properties list of the widget, given the class of the container we are adding the widget to. If the widget already has packing_properties, but the container has changed, the current list is freed and replaced.

#### Parameters

widget | A GladeWidget |
container | The parent GladeWidget |

### glade_widget_get_property ()

    GladeProperty *
    glade_widget_get_property (GladeWidget *widget,
                               const gchar *id_property);

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |

#### Returns

the GladeProperty in `widget` named `id_property` .

[transfer none][nullable]

### glade_widget_get_pack_property ()

    GladeProperty *
    glade_widget_get_pack_property (GladeWidget *widget,
                                    const gchar *id_property);

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |

#### Returns

the GladeProperty in `widget` named `id_property` .

[transfer none][nullable]

### glade_widget_dup_properties ()

    GList *
    glade_widget_dup_properties (GladeWidget *dest_widget,
                                 GList *template_props,
                                 gboolean as_load,
                                 gboolean copy_parentless,
                                 gboolean exact);

Copies a list of properties, if `as_load` is specified, then properties that are not saved to the glade file are ignored.

#### Parameters

dest_widget | the widget we are copying properties for |
template_props | the GladeProperty list to copy. | [element-type GladeProperty]
as_load | whether to behave as if loading the project |
copy_parentless | whether to copy reffed widgets at all |
exact | whether to copy reffed widgets exactly |

#### Returns

A newly allocated GList of new GladeProperty objects.

[transfer full][element-type GladeProperty]

### glade_widget_remove_property ()

    void
    glade_widget_remove_property (GladeWidget *widget,
                                  const gchar *id_property);

Removes the GladeProperty indicated by `id_property` from `widget` (this is intended for use in the plugin, to remove properties from composite children that don't make sense to allow the user to specify, notably - properties that are proxied through the composite widget's properties or style properties).

#### Parameters

widget | A GladeWidget |
id_property | the name of the property |

### glade_widget_show ()

    void
    glade_widget_show (GladeWidget *widget);

Display `widget` in it's project's GladeDesignView

#### Parameters

widget | A GladeWidget |

### glade_widget_hide ()

    void
    glade_widget_hide (GladeWidget *widget);

Hide `widget`

#### Parameters

widget | A GladeWidget |

### glade_widget_add_signal_handler ()

    void
    glade_widget_add_signal_handler (GladeWidget *widget,
                                     const GladeSignal *signal_handler);

Adds a signal handler for `widget`

#### Parameters

widget | A GladeWidget |
signal_handler | The GladeSignal |

### glade_widget_remove_signal_handler ()

    void
    glade_widget_remove_signal_handler (GladeWidget *widget,
                                        const GladeSignal *signal_handler);

Removes a signal handler from `widget`

#### Parameters

widget | A GladeWidget |
signal_handler | The GladeSignal |

### glade_widget_change_signal_handler ()

    void
    glade_widget_change_signal_handler (GladeWidget *widget,
                                        const GladeSignal *old_signal_handler,
                                        const GladeSignal *new_signal_handler);

Changes a GladeSignal on `widget`

#### Parameters

widget | A GladeWidget |
old_signal_handler | the old GladeSignal |
new_signal_handler | the new GladeSignal |

### glade_widget_list_signal_handlers ()

    GPtrArray *
    glade_widget_list_signal_handlers (GladeWidget *widget,
                                       const gchar *signal_name);

#### Parameters

widget | a GladeWidget |
signal_name | the name of the signal |

#### Returns

A GPtrArray of GladeSignal for `signal_name` .

[transfer none][element-type GladeSignal]

### glade_widget_has_decendant ()

    gboolean
    glade_widget_has_decendant (GladeWidget *widget,
                                GType type);

#### Parameters

widget | a GladeWidget |
type | a GType |

#### Returns

whether this GladeWidget has any descendants of type `type` or any descendants that implement the `type` interface

### glade_widget_event ()

    gboolean
    glade_widget_event (GladeWidget *gwidget,
                        GdkEvent *event);

Feed an event to be handled on the project GladeWidget hierarchy.

#### Parameters

gwidget | A GladeWidget |
event | A GdkEvent |

#### Returns

whether the event was handled or not.

### glade_widget_placeholder_relation ()

    gboolean
    glade_widget_placeholder_relation (GladeWidget *parent,
                                       GladeWidget *widget);

Returns whether placeholders should be used in operations concerning this parent & child.

Currently that criteria is whether `parent` is a GtkContainer, `widget` is a GtkWidget and the parent adaptor has been marked to use placeholders.

#### Parameters

parent | A GladeWidget |
widget | The child GladeWidget |

#### Returns

whether to use placeholders for this relationship.

### glade_widget_get_action ()

    GladeWidgetAction *
    glade_widget_get_action (GladeWidget *widget,
                             const gchar *action_path);

Returns a GladeWidgetAction object indentified by `action_path` .

#### Parameters

widget | a GladeWidget |
action_path | a full action path including groups |

#### Returns

the action or `NULL` if not found.

[transfer none][nullable]

### glade_widget_get_pack_action ()

    GladeWidgetAction *
    glade_widget_get_pack_action (GladeWidget *widget,
                                  const gchar *action_path);

Returns a GladeWidgetAction object indentified by `action_path` .

#### Parameters

widget | a GladeWidget |
action_path | a full action path including groups |

#### Returns

the action or `NULL` if not found.

[transfer none][nullable]

### glade_widget_set_action_visible ()

    gboolean
    glade_widget_set_action_visible (GladeWidget *widget,
                                     const gchar *action_path,
                                     gboolean visible);

Sets the visibility of `action_path` in `widget`

#### Parameters

widget | a GladeWidget |
action_path | a full action path including groups |
visible | setting visible or invisible |

#### Returns

whether `action_path` was found or not.

### glade_widget_set_action_sensitive ()

    gboolean
    glade_widget_set_action_sensitive (GladeWidget *widget,
                                       const gchar *action_path,
                                       gboolean sensitive);

Sets the sensitivity of `action_path` in `widget`

#### Parameters

widget | a GladeWidget |
action_path | a full action path including groups |
sensitive | setting sensitive or insensitive |

#### Returns

whether `action_path` was found or not.

### glade_widget_set_pack_action_sensitive ()

    gboolean
    glade_widget_set_pack_action_sensitive
                                   (GladeWidget *widget,
                                    const gchar *action_path,
                                    gboolean sensitive);

Sets the sensitivity of `action_path` in `widget`

#### Parameters

widget | a GladeWidget |
action_path | a full action path including groups |
sensitive | setting sensitive or insensitive |

#### Returns

whether `action_path` was found or not.

### glade_widget_add_prop_ref ()

    void
    glade_widget_add_prop_ref (GladeWidget *widget,
                               GladeProperty *property);

Adds `property` to `widget` 's list of referenced properties.

Note: this is used to track properties on other objects that refer to this object.

#### Parameters

widget | A GladeWidget |
property | the GladeProperty |

### glade_widget_remove_prop_ref ()

    void
    glade_widget_remove_prop_ref (GladeWidget *widget,
                                  GladeProperty *property);

Removes `property` from `widget` 's list of referenced properties.

Note: this is used to track properties on other objects that refer to this object.

#### Parameters

widget | A GladeWidget |
property | the GladeProperty |

### glade_widget_object_set_property ()

    void
    glade_widget_object_set_property (GladeWidget *widget,
                                      const gchar *property_name,
                                      const GValue *value);

This function applies `value` to the property `property_name` on the runtime object of `widget` .

#### Parameters

widget | A GladeWidget |
property_name | The property identifier |
value | The GValue |

### glade_widget_object_get_property ()

    void
    glade_widget_object_get_property (GladeWidget *widget,
                                      const gchar *property_name,
                                      GValue *value);

This function retrieves the value of the property `property_name` on the runtime object of `widget` and sets it in `value` .

#### Parameters

widget | A GladeWidget |
property_name | The property identifier |
value | The GValue |

### glade_widget_child_set_property ()

    void
    glade_widget_child_set_property (GladeWidget *widget,
                                     GladeWidget *child,
                                     const gchar *property_name,
                                     const GValue *value);

Sets `child` 's packing property identified by `property_name` to `value` .

#### Parameters

widget | A GladeWidget |
child | The GladeWidget child |
property_name | The id of the property |
value | The `GValue` |

### glade_widget_child_get_property ()

    void
    glade_widget_child_get_property (GladeWidget *widget,
                                     GladeWidget *child,
                                     const gchar *property_name,
                                     GValue *value);

Gets `child` 's packing property identified by `property_name` .

#### Parameters

widget | A GladeWidget |
child | The GladeWidget child |
property_name | The id of the property |
value | The `GValue` |

### glade_widget_property_get ()

    gboolean
    glade_widget_property_get (GladeWidget *widget,
                               const gchar *id_property,
                               ...);

Gets the value of `id_property` in `widget`

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |
... | The return location for the value of the said GladeProperty |

#### Returns

whether `id_property` was found or not.

### glade_widget_property_set ()

    gboolean
    glade_widget_property_set (GladeWidget *widget,
                               const gchar *id_property,
                               ...);

Sets the value of `id_property` in `widget`

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |
... | A value of the correct type for the said GladeProperty |

#### Returns

whether `id_property` was found or not.

### glade_widget_pack_property_get ()

    gboolean
    glade_widget_pack_property_get (GladeWidget *widget,
                                    const gchar *id_property,
                                    ...);

Gets the value of `id_property` in `widget` packing properties

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |
... | The return location for the value of the said GladeProperty |

#### Returns

whether `id_property` was found or not.

### glade_widget_pack_property_set ()

    gboolean
    glade_widget_pack_property_set (GladeWidget *widget,
                                    const gchar *id_property,
                                    ...);

Sets the value of `id_property` in `widget` packing properties

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |
... | The return location for the value of the said GladeProperty |

#### Returns

whether `id_property` was found or not.

### glade_widget_property_reset ()

    gboolean
    glade_widget_property_reset (GladeWidget *widget,
                                 const gchar *id_property);

Resets `id_property` in `widget` to it's default value

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |

#### Returns

whether `id_property` was found or not.

### glade_widget_pack_property_reset ()

    gboolean
    glade_widget_pack_property_reset (GladeWidget *widget,
                                      const gchar *id_property);

Resets `id_property` in `widget` 's packing properties to it's default value

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |

#### Returns

whether `id_property` was found or not.

### glade_widget_property_default ()

    gboolean
    glade_widget_property_default (GladeWidget *widget,
                                   const gchar *id_property);

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |

#### Returns

whether whether `id_property` was found and is currently set to it's default value.

### glade_widget_property_original_default ()

    gboolean
    glade_widget_property_original_default
                                   (GladeWidget *widget,
                                    const gchar *id_property);

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |

#### Returns

whether whether `id_property` was found and is currently set to it's original default value.

### glade_widget_pack_property_default ()

    gboolean
    glade_widget_pack_property_default (GladeWidget *widget,
                                        const gchar *id_property);

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |

#### Returns

whether whether `id_property` was found and is currently set to it's default value.

### glade_widget_property_set_sensitive ()

    gboolean
    glade_widget_property_set_sensitive (GladeWidget *widget,
                                         const gchar *id_property,
                                         gboolean sensitive,
                                         const gchar *reason);

Sets the sensitivity of `id_property` in `widget`

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |
sensitive | setting sensitive or insensitive |
reason | a description of why the user cant edit this property which will be used as a tooltip |

#### Returns

whether `id_property` was found or not.

### glade_widget_pack_property_set_sensitive ()

    gboolean
    glade_widget_pack_property_set_sensitive
                                   (GladeWidget *widget,
                                    const gchar *id_property,
                                    gboolean sensitive,
                                    const gchar *reason);

Sets the sensitivity of `id_property` in `widget` 's packing properties.

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |
sensitive | setting sensitive or insensitive |
reason | a description of why the user cant edit this property which will be used as a tooltip |

#### Returns

whether `id_property` was found or not.

### glade_widget_property_set_enabled ()

    gboolean
    glade_widget_property_set_enabled (GladeWidget *widget,
                                       const gchar *id_property,
                                       gboolean enabled);

Sets the enabled state of `id_property` in `widget` ; this is used for optional properties.

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |
enabled | setting enabled or disabled |

#### Returns

whether `id_property` was found or not.

### glade_widget_pack_property_set_enabled ()

    gboolean
    glade_widget_pack_property_set_enabled
                                   (GladeWidget *widget,
                                    const gchar *id_property,
                                    gboolean enabled);

Sets the enabled state of `id_property` in `widget` 's packing properties; this is used for optional properties.

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |
enabled | setting enabled or disabled |

#### Returns

whether `id_property` was found or not.

### glade_widget_property_set_save_always ()

    gboolean
    glade_widget_property_set_save_always (GladeWidget *widget,
                                           const gchar *id_property,
                                           gboolean setting);

Sets whether `id_property` in `widget` should be special cased to always be saved regardless of its default value. (used for some special cases like properties that are assigned initial values in composite widgets or derived widget code).

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |
setting | the setting |

#### Returns

whether `id_property` was found or not.

### glade_widget_pack_property_set_save_always ()

    gboolean
    glade_widget_pack_property_set_save_always
                                   (GladeWidget *widget,
                                    const gchar *id_property,
                                    gboolean setting);

Sets whether `id_property` in `widget` should be special cased to always be saved regardless of its default value. (used for some special cases like properties that are assigned initial values in composite widgets or derived widget code).

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |
setting | the setting |

#### Returns

whether `id_property` was found or not.

### glade_widget_property_string ()

    gchar *
    glade_widget_property_string (GladeWidget *widget,
                                  const gchar *id_property,
                                  const GValue *value);

Creates a printable string representing `id_property` in `widget` , if `value` is specified it will be used in place of `id_property` 's real value (this is a convenience function to print/debug properties usually from plugin backends).

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |
value | the GValue to print or `NULL` |

#### Returns

A newly allocated string representing `id_property`

### glade_widget_pack_property_string ()

    gchar *
    glade_widget_pack_property_string (GladeWidget *widget,
                                       const gchar *id_property,
                                       const GValue *value);

Same as `glade_widget_property_string()` but for packing properties.

#### Parameters

widget | a GladeWidget |
id_property | a string naming a GladeProperty |
value | the GValue to print or `NULL` |

#### Returns

A newly allocated string representing `id_property`

### glade_widget_set_name ()

    void
    glade_widget_set_name (GladeWidget *widget,
                           const gchar *name);

Sets `widget` 's name to `name` .

#### Parameters

widget | a GladeWidget |
name | a string |

### glade_widget_get_name ()

    const gchar *
    glade_widget_get_name (GladeWidget *widget);

#### Parameters

widget | a GladeWidget |

#### Returns

a pointer to `widget` 's name

This is what will be serialized as the widget's ID, unless the name currently carries the `GLADE_UNNAMED_PREFIX`.

### glade_widget_set_internal ()

    void
    glade_widget_set_internal (GladeWidget *widget,
                               const gchar *internal);

Sets the internal name of `widget` to `internal`

#### Parameters

widget | A GladeWidget |
internal | The internal name |

### glade_widget_get_internal ()

    const gchar *
    glade_widget_get_internal (GladeWidget *widget);

#### Parameters

widget | a GladeWidget |

#### Returns

the internal name of `widget`

### glade_widget_get_object ()

    GObject *
    glade_widget_get_object (GladeWidget *widget);

#### Parameters

widget | a GladeWidget |

#### Returns

the GObject associated with `widget` .

[transfer none]

### glade_widget_set_project ()

    void
    glade_widget_set_project (GladeWidget *widget,
                              GladeProject *project);

Makes `widget` belong to `project` .

#### Parameters

widget | a GladeWidget |
project | a GladeProject |

### glade_widget_get_project ()

    GladeProject *
    glade_widget_get_project (GladeWidget *widget);

#### Parameters

widget | a GladeWidget |

#### Returns

the GladeProject that `widget` belongs to.

[transfer none]

### glade_widget_get_adaptor ()

    GladeWidgetAdaptor *
    glade_widget_get_adaptor (GladeWidget *widget);

#### Parameters

widget | a GladeWidget |

#### Returns

the GladeWidgetAdaptor of `widget` .

[transfer none]

### glade_widget_get_parent ()

    GladeWidget *
    glade_widget_get_parent (GladeWidget *widget);

#### Parameters

widget | A GladeWidget |

#### Returns

The parenting GladeWidget.

[transfer none]

### glade_widget_set_parent ()

    void
    glade_widget_set_parent (GladeWidget *widget,
                             GladeWidget *parent);

sets the parenting GladeWidget

#### Parameters

widget | A GladeWidget |
parent | the parenting GladeWidget (or `NULL`). | [nullable]

### glade_widget_superuser ()

    gboolean
    glade_widget_superuser (void);

Checks if we are in superuser mode.

Superuser mode is when we are

- Loading a project

- Dupping a widget recursively

- Rebuilding an instance for a construct-only property

In these cases, we must act like a load, this should be checked from the plugin when implementing containers, when undo/redo comes around, the plugin is responsable for maintaining the same container size when widgets are added/removed.

### glade_widget_push_superuser ()

    void
    glade_widget_push_superuser (void);

Sets superuser mode

### glade_widget_pop_superuser ()

    void
    glade_widget_pop_superuser (void);

Unsets superuser mode

### glade_widget_add_verify ()

    gboolean
    glade_widget_add_verify (GladeWidget *widget,
                             GladeWidget *child,
                             gboolean user_feedback);

Checks whether `child` can be added to `parent` .

If `user_feedback` is `TRUE` and `child` cannot be added then this shows a notification dialog to the user explaining why.

#### Parameters

widget | A GladeWidget |
child | The child GladeWidget to add |
user_feedback | whether a notification dialog should be presented in the case that the child cannot not be added. |

#### Returns

whether `child` can be added to `widget` .

### glade_widget_depends ()

    gboolean
    glade_widget_depends (GladeWidget *widget,
                          GladeWidget *other);

`glade_widget_depends` has been deprecated since version 3.18 and should not be used in newly-written code.

Determines whether `widget` is somehow dependent on `other` , in which case it should be serialized after `other` .

A widget is dependent on another widget. It does not take into account for children dependencies.

#### Parameters

widget | a GladeWidget |
other | another GladeWidget |

#### Returns

`TRUE` if `widget` depends on `other` .

### glade_widget_ensure_name ()

    void
    glade_widget_ensure_name (GladeWidget *widget,
                              GladeProject *project,
                              gboolean use_command);

### glade_widget_find_child ()

    GladeWidget *
    glade_widget_find_child (GladeWidget *widget,
                             const gchar *name);

Finds a child widget named `name` .

#### Parameters

widget | A GladeWidget |
name | child name |

#### Returns

The child of widget or `NULL` if it was not found.

[nullable][transfer none]

### glade_widget_generate_path_name ()

    gchar *
    glade_widget_generate_path_name (GladeWidget *widget);

Creates a user friendly name to describe project widgets

#### Parameters

widget | A GladeWidget |

#### Returns

A newly allocated string

### glade_widget_get_actions ()

    GList *
    glade_widget_get_actions (GladeWidget *widget);

#### Parameters

widget | a GladeWidget |

#### Returns

the list of GladeWidgetAction.

[transfer none][element-type GladeWidgetAction]

### glade_widget_get_children ()

    GList *
    glade_widget_get_children (GladeWidget *widget);

Fetches any wrapped children of `widget` .

#### Parameters

widget | A GladeWidget |

#### Returns

The children of widget

This differs from a direct call to `glade_widget_adaptor_get_children()` as it only returns children which have an associated GladeWidget. This function will not return any placeholders or internal composite children that have not been exposed for Glade configuration

.

[transfer container][element-type GObject]

### glade_widget_get_device_from_event ()

    GdkDevice *
    glade_widget_get_device_from_event (GdkEvent *event);

`glade_widget_get_device_from_event` is deprecated and should not be used in newly-written code.

use `gdk_event_get_device()` instead.

Currently only motion and button events are handled (see GLADE_WIDGET_IS_EVENT)

#### Parameters

event | a GdkEvent |

#### Returns

the associated GdkDevice for this glade widget event.

[transfer none]

### glade_widget_get_display_name ()

    const gchar *
    glade_widget_get_display_name (GladeWidget *widget);

#### Parameters

widget | a GladeWidget |

#### Returns

a pointer to `widget` 's displayable name

This should be used to display the widget's ID in the UI, it will automatically return the class name if the widget has no name.

### glade_widget_set_is_composite ()

    void
    glade_widget_set_is_composite (GladeWidget *widget,
                                   gboolean composite);

Set's this widget to be toplevel composite object to be eventually used with `gtk_widget_class_set_template()`

Only one widget in a project should be composite.

#### Parameters

widget | a GladeWidget |
composite | whether `widget` should be a composite template |

### glade_widget_get_is_composite ()

    gboolean
    glade_widget_get_is_composite (GladeWidget *widget);

Checks if `widget` is a composite template to be used with `gtk_widget_class_set_template()`.

#### Parameters

widget | a GladeWidget |

#### Returns

whether `widget` is composite.

### glade_widget_get_locker ()

    GladeWidget *
    glade_widget_get_locker (GladeWidget *widget);

Get the current locked widget, locked widgets cannot be removed from the project until unlocked

#### Parameters

widget | A GladeWidget |

#### Returns

a GladeWidget or `NULL` if none is locked.

[transfer none][nullable]

### glade_widget_get_pack_actions ()

    GList *
    glade_widget_get_pack_actions (GladeWidget *widget);

#### Parameters

widget | a GladeWidget |

#### Returns

the list of GladeWidgetAction.

[transfer none][element-type GladeWidgetAction]

### glade_widget_get_packing_properties ()

    GList *
    glade_widget_get_packing_properties (GladeWidget *widget);

#### Parameters

widget | A GladeWidget |

#### Returns

the list of GladeProperty.

[transfer none][element-type GladeProperty]

### glade_widget_get_parentless_reffed_widgets ()

    GList *
    glade_widget_get_parentless_reffed_widgets
                                   (GladeWidget *widget);

#### Parameters

widget | A GladeWidget |

#### Returns

a list of GladeProperty.

[transfer container][element-type GladeProperty]

### glade_widget_get_parentless_widget_ref ()

    GladeProperty *
    glade_widget_get_parentless_widget_ref
                                   (GladeWidget *widget);

#### Parameters

widget | A GladeWidget |

#### Returns

a GladeProperty.

[transfer none]

### glade_widget_get_properties ()

    GList *
    glade_widget_get_properties (GladeWidget *widget);

#### Parameters

widget | A GladeWidget |

#### Returns

the list of GladeProperty.

[transfer none][element-type GladeProperty]

### glade_widget_get_signal_list ()

    GList *
    glade_widget_get_signal_list (GladeWidget *widget);

Compiles a list of GladeSignal elements

#### Parameters

widget | a 'dest' GladeWidget |

#### Returns

a newly allocated GList of GladeSignal, the caller must call `g_list_free()` to free the list.

[transfer container][element-type GladeSignal]

### glade_widget_get_signal_model ()

    GtkTreeModel *
    glade_widget_get_signal_model (GladeWidget *widget);

#### Parameters

widget | A GladeWidget |

#### Returns

a GtkTreeModel that can be used to view the widget's signals. The signal model is owned by the GladeWidget.

[transfer none]

### glade_widget_get_toplevel ()

    GladeWidget *
    glade_widget_get_toplevel (GladeWidget *widget);

#### Parameters

widget | A GladeWidget |

#### Returns

The toplevel GladeWidget in the hierarchy (or `widget` ).

[transfer none]

### glade_widget_has_name ()

    gboolean
    glade_widget_has_name (GladeWidget *widget);

#### Parameters

widget | a GladeWidget |

#### Returns

whether the user has named this widget with an ID

### glade_widget_has_prop_refs ()

    gboolean
    glade_widget_has_prop_refs (GladeWidget *widget);

### glade_widget_set_in_project ()

    void
    glade_widget_set_in_project (GladeWidget *widget,
                                 gboolean in_project);

### glade_widget_in_project ()

    gboolean
    glade_widget_in_project (GladeWidget *widget);

### glade_widget_is_ancestor ()

    gboolean
    glade_widget_is_ancestor (GladeWidget *widget,
                              GladeWidget *ancestor);

Determines whether `widget` is somewhere inside `ancestor` , possibly with intermediate containers.

#### Parameters

widget | a GladeWidget |
ancestor | another GladeWidget |

#### Returns

`TRUE` if `ancestor` contains `widget` as a child, grandchild, great grandchild, etc.

### glade_widget_list_locked_widgets ()

    GList *
    glade_widget_list_locked_widgets (GladeWidget *widget);

#### Parameters

widget | A GladeWidget |

#### Returns

the list of GladeWidget.

[transfer container][element-type GladeWidget]

### glade_widget_list_prop_refs ()

    GList *
    glade_widget_list_prop_refs (GladeWidget *widget);

#### Parameters

widget | A GladeWidget |

#### Returns

a list of GladeProperty.

[transfer container][element-type GladeProperty]

### glade_widget_lock ()

    void
    glade_widget_lock (GladeWidget *widget,
                       GladeWidget *locked);

Sets `locked` to be in a locked up state spoken for by `widget` , locked widgets cannot be removed from the project until unlocked.

#### Parameters

widget | A GladeWidget |
locked | The GladeWidget to lock |

### glade_widget_unlock ()

    void
    glade_widget_unlock (GladeWidget *widget);

Unlocks `widget` so that it can be removed from the project again

#### Parameters

widget | A GladeWidget |

### glade_widget_set_pack_action_visible ()

    gboolean
    glade_widget_set_pack_action_visible (GladeWidget *widget,
                                          const gchar *action_path,
                                          gboolean visible);

Sets the visibility of `action_path` in `widget`

#### Parameters

widget | a GladeWidget |
action_path | a full action path including groups |
visible | setting visible or invisible |

#### Returns

whether `action_path` was found or not.

### glade_widget_set_support_warning ()

    void
    glade_widget_set_support_warning (GladeWidget *widget,
                                      const gchar *warning);

### glade_widget_support_changed ()

    void
    glade_widget_support_changed (GladeWidget *widget);

Notifies that support metadata has changed on the widget.

#### Parameters

widget | A GladeWidget |

### glade_widget_support_warning ()

    const gchar *
    glade_widget_support_warning (GladeWidget *widget);

### glade_widget_verify ()

    void
    glade_widget_verify (GladeWidget *widget);

Verify this widget for deprecation and versioning warnings.

This function will update the widget's support warning.

#### Parameters

widget | A GladeWidget |

### glade_widget_write_signals ()

    void
    glade_widget_write_signals (GladeWidget *widget,
                                GladeXmlContext *context,
                                GladeXmlNode *node);

## Types and Values

### GladeWidget

    typedef struct {
      GInitiallyUnowned parent_instance;

      GladeWidgetPrivate *priv;
    } GladeWidget;

### GLADE_UNNAMED_PREFIX

    #define GLADE_UNNAMED_PREFIX   "__glade_unnamed_"