AmtkFactoryMenu: Tepl 3 Reference Manual

## AmtkFactoryMenu AmtkFactoryMenu — A factory that creates GtkMenuItem's |

## Functions

AmtkFactoryMenu * | amtk_factory_menu_new ()
AmtkFactoryMenu * | amtk_factory_menu_new_with_default_application ()
GtkWidget * | amtk_factory_menu_create_menu_item ()
GtkWidget * | amtk_factory_menu_create_menu_item_full ()

## Types and Values

| AmtkFactoryMenu

## Object Hierarchy

        GObject
        ╰── AmtkFactory
            ╰── AmtkFactoryMenu

## Includes

    #include <tepl/tepl.h>

## Description

AmtkFactoryMenu permits to create GtkMenuItem's from AmtkActionInfo's.

If not ignored by an AmtkFactoryFlags, the first accelerator returned by `amtk_action_info_get_accels()` is set to the GtkAccelLabel of the GtkMenuItem.

If not ignored by an AmtkFactoryFlags, the tooltip is set with `amtk_menu_item_set_long_description()`, which permits to display it in a GtkStatusbar with `amtk_application_window_connect_menu_to_statusbar()`.

## Functions

### amtk_factory_menu_new ()

    AmtkFactoryMenu *
    amtk_factory_menu_new (GtkApplication *application);

Creates a new AmtkFactoryMenu object. Associating a GtkApplication is optional.

#### Parameters

application | a GtkApplication, or `NULL`. | [nullable]

#### Returns

a new AmtkFactoryMenu.

Since: 3.0

### amtk_factory_menu_new_with_default_application ()

    AmtkFactoryMenu *
    amtk_factory_menu_new_with_default_application
                                   (void);

Calls `amtk_factory_menu_new()` with `g_application_get_default()` (it must be a GtkApplication).

#### Returns

a new AmtkFactoryMenu with the default GtkApplication.

Since: 3.0

### amtk_factory_menu_create_menu_item ()

    GtkWidget *
    amtk_factory_menu_create_menu_item (AmtkFactoryMenu *factory,
                                        const gchar *action_name);

Creates a new GtkMenuItem for `action_name` with the “default-flags”.

#### Parameters

factory | an AmtkFactoryMenu. |
action_name | an action name. |

#### Returns

a new GtkMenuItem for `action_name` .

[transfer floating]

Since: 3.0

### amtk_factory_menu_create_menu_item_full ()

    GtkWidget *
    amtk_factory_menu_create_menu_item_full
                                   (AmtkFactoryMenu *factory,
                                    const gchar *action_name,
                                    AmtkFactoryFlags flags);

This function ignores the “default-flags” property and takes the `flags` argument instead.

#### Parameters

factory | an AmtkFactoryMenu. |
action_name | an action name. |
flags | AmtkFactoryFlags. |

#### Returns

a new GtkMenuItem for `action_name` .

[transfer floating]

Since: 3.0

## Types and Values

### AmtkFactoryMenu

    typedef struct _AmtkFactoryMenu AmtkFactoryMenu;