GntBindable: GNT Reference Manual

## GntBindable GntBindable — Key-bindable GObjects |

## Functions

GType | gnt_bindable_get_gtype ()
const char * | gnt_bindable_remap_keys ()
gboolean | (*GntBindableActionCallback) ()
gboolean | (*GntBindableActionCallbackNoParam) ()
void | gnt_bindable_action_free ()
void | gnt_bindable_action_param_free ()
void | gnt_bindable_class_register_action ()
void | gnt_bindable_register_binding ()
gboolean | gnt_bindable_perform_action_key ()
gboolean | gnt_bindable_check_key ()
gboolean | gnt_bindable_perform_action_named ()
GntBindable * | gnt_bindable_bindings_view ()
gboolean | gnt_bindable_build_help_window ()

## Types and Values

#define | GNTDEBUG
struct | GntBindableAction
struct | GntBindableActionParam

## Object Hierarchy

        GObject
        ╰── GntBindable
            ╰── GntWidget

## Description

## Functions

### gnt_bindable_get_gtype ()

    GType
    gnt_bindable_get_gtype (void);

### gnt_bindable_remap_keys ()

    const char *
    gnt_bindable_remap_keys (GntBindable *bindable,
                             const char *text);

### GntBindableActionCallback ()

    gboolean
    (*GntBindableActionCallback) (GntBindable *bindable,
                                  GList *params);

### GntBindableActionCallbackNoParam ()

    gboolean
    (*GntBindableActionCallbackNoParam) (GntBindable *bindable);

### gnt_bindable_action_free ()

    void
    gnt_bindable_action_free (GntBindableAction *action);

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

This is an internal implementation detail.

Free a bindable action.

#### Parameters

action | The bindable action. |

### gnt_bindable_action_param_free ()

    void
    gnt_bindable_action_param_free (GntBindableActionParam *param);

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

This is an internal implementation detail.

Free a GntBindableActionParam.

#### Parameters

param | The GntBindableActionParam to free. |

### gnt_bindable_class_register_action ()

    void
    gnt_bindable_class_register_action (GntBindableClass *klass,
                                        const char *name,
                                        GntBindableActionCallback callback,
                                        const char *trigger,
                                        ...);

Register a bindable action for a class.

#### Parameters

klass | The class the binding is for. |
name | The name of the binding. |
callback | The callback for the binding. | [scope call]
trigger | The default trigger for the binding, or `NULL`, followed by a `NULL`-terminated list of default parameters. |

### gnt_bindable_register_binding ()

    void
    gnt_bindable_register_binding (GntBindableClass *klass,
                                   const char *name,
                                   const char *trigger,
                                   ...);

Register a key-binding to an existing action.

#### Parameters

klass | The class the binding is for. |
name | The name of the binding. |
trigger | A new trigger for the binding, followed by a `NULL`-terminated list of parameters for the callback. |

### gnt_bindable_perform_action_key ()

    gboolean
    gnt_bindable_perform_action_key (GntBindable *bindable,
                                     const char *keys);

Perform an action from a keybinding.

#### Parameters

bindable | The bindable object. |
keys | The key to trigger the action. |

#### Returns

`TRUE` if the action was performed successfully, `FALSE` otherwise.

### gnt_bindable_check_key ()

    gboolean
    gnt_bindable_check_key (GntBindable *bindable,
                            const char *keys);

Discover if a key is bound.

#### Parameters

bindable | The bindable object. |
keys | The key to check for. |

#### Returns

`TRUE` if the the key has an action associated with it.

Since: 2.4.2

### gnt_bindable_perform_action_named ()

    gboolean
    gnt_bindable_perform_action_named (GntBindable *bindable,
                                       const char *name,
                                       ...);

Perform an action on a bindable object.

#### Parameters

bindable | The bindable object. |
name | The action to perform, followed by a `NULL`-terminated list of parameters. |

#### Returns

`TRUE` if the action was performed successfully, `FALSE` otherwise.

### gnt_bindable_bindings_view ()

    GntBindable *
    gnt_bindable_bindings_view (GntBindable *bind);

Returns a GntTree populated with "key" -> "binding" for the widget.

#### Parameters

bind | The object to list the bindings for. |

#### Returns

The GntTree.

[transfer full]

Since: 2.1.1

### gnt_bindable_build_help_window ()

    gboolean
    gnt_bindable_build_help_window (GntBindable *bindable);

Builds a window that list the key bindings for a GntBindable object. From this window a user can select a listing to rebind a new key for the given action.

#### Parameters

bindable | The object to list the bindings for. |

#### Returns

`TRUE`

Since: 2.1.1

## Types and Values

### GNTDEBUG

    #define GNTDEBUG

### struct GntBindableAction

    struct GntBindableAction {
    	char *name;        /* The name of the action */
    	union {
    		GntBindableActionCallback action;
    		GntBindableActionCallbackNoParam action_noparam;
    	} u;
    };

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

This is an internal implementation detail.

### struct GntBindableActionParam

    struct GntBindableActionParam {
    	struct _GntBindableAction *action;
    	GList *list;
    };

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

This is an internal implementation detail.