CtkMenuBar: CTK+ 3 Reference Manual

## CtkMenuBar CtkMenuBar — A subclass of CtkMenuShell which holds CtkMenuItem widgets |

## Functions

CtkWidget * | ctk_menu_bar_new ()
CtkWidget * | ctk_menu_bar_new_from_model ()
void | ctk_menu_bar_set_pack_direction ()
CtkPackDirection | ctk_menu_bar_get_pack_direction ()
void | ctk_menu_bar_set_child_pack_direction ()
CtkPackDirection | ctk_menu_bar_get_child_pack_direction ()

## Properties

CtkPackDirection | child-pack-direction | Read / Write
CtkPackDirection | pack-direction | Read / Write

## Types and Values

struct | CtkMenuBar
enum | CtkPackDirection

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── CtkWidget
                ╰── CtkContainer
                    ╰── CtkMenuShell
                        ╰── CtkMenuBar

## Implemented Interfaces

CtkMenuBar implements AtkImplementorIface and CtkBuildable.

## Includes

    #include <ctk/ctk.h>

## Description

The CtkMenuBar is a subclass of CtkMenuShell which contains one or more CtkMenuItems. The result is a standard menu bar which can hold many menu items.

### CSS nodes

CtkMenuBar has a single CSS node with name menubar.

## Functions

### ctk_menu_bar_new ()

    CtkWidget *
    ctk_menu_bar_new (void);

Creates a new CtkMenuBar

#### Returns

the new menu bar, as a CtkWidget

### ctk_menu_bar_new_from_model ()

    CtkWidget *
    ctk_menu_bar_new_from_model (GMenuModel *model);

Creates a new CtkMenuBar and populates it with menu items and submenus according to `model` .

The created menu items are connected to actions found in the CtkApplicationWindow to which the menu bar belongs - typically by means of being contained within the CtkApplicationWindows widget hierarchy.

#### Parameters

model | a GMenuModel |

#### Returns

a new CtkMenuBar

Since: 3.4

### ctk_menu_bar_set_pack_direction ()

    void
    ctk_menu_bar_set_pack_direction (CtkMenuBar *menubar,
                                     CtkPackDirection pack_dir);

Sets how items should be packed inside a menubar.

#### Parameters

menubar | a CtkMenuBar |
pack_dir | a new CtkPackDirection |

Since: 2.8

### ctk_menu_bar_get_pack_direction ()

    CtkPackDirection
    ctk_menu_bar_get_pack_direction (CtkMenuBar *menubar);

Retrieves the current pack direction of the menubar. See `ctk_menu_bar_set_pack_direction()`.

#### Parameters

menubar | a CtkMenuBar |

#### Returns

the pack direction

Since: 2.8

### ctk_menu_bar_set_child_pack_direction ()

    void
    ctk_menu_bar_set_child_pack_direction (CtkMenuBar *menubar,
                                           CtkPackDirection child_pack_dir);

Sets how widgets should be packed inside the children of a menubar.

#### Parameters

menubar | a CtkMenuBar |
child_pack_dir | a new CtkPackDirection |

Since: 2.8

### ctk_menu_bar_get_child_pack_direction ()

    CtkPackDirection
    ctk_menu_bar_get_child_pack_direction (CtkMenuBar *menubar);

Retrieves the current child pack direction of the menubar. See `ctk_menu_bar_set_child_pack_direction()`.

#### Parameters

menubar | a CtkMenuBar |

#### Returns

the child pack direction

Since: 2.8

## Types and Values

### struct CtkMenuBar

    struct CtkMenuBar;

### enum CtkPackDirection

Determines how widgets should be packed inside menubars and menuitems contained in menubars.

#### Members

CTK_PACK_DIRECTION_LTR | Widgets are packed left-to-right |
CTK_PACK_DIRECTION_RTL | Widgets are packed right-to-left |
CTK_PACK_DIRECTION_TTB | Widgets are packed top-to-bottom |
CTK_PACK_DIRECTION_BTT | Widgets are packed bottom-to-top |

## Property Details

### The `“child-pack-direction”` property

      “child-pack-direction”     CtkPackDirection

The child pack direction of the menubar. It determines how the widgets contained in child menuitems are arranged.

Owner: CtkMenuBar

Flags: Read / Write

Default value: CTK_PACK_DIRECTION_LTR

Since: 2.8

### The `“pack-direction”` property

      “pack-direction”           CtkPackDirection

The pack direction of the menubar. It determines how menuitems are arranged in the menubar.

Owner: CtkMenuBar

Flags: Read / Write

Default value: CTK_PACK_DIRECTION_LTR

Since: 2.8

## See Also

CtkMenuShell, CtkMenu, CtkMenuItem