Gtk.MenuBar¶
Example¶
- Subclasses:
 None
Methods¶
- Inherited:
 Gtk.MenuShell (14), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)
- Structs:
 Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class  | 
  | 
class  | 
  | 
  | 
|
  | 
Virtual Methods¶
Properties¶
- Inherited:
 
Name  | 
Type  | 
Flags  | 
Short Description  | 
|---|---|---|---|
r/w/en  | 
The child pack direction of the menubar  | 
||
r/w/en  | 
The pack direction of the menubar  | 
Style Properties¶
- Inherited:
 
Name  | 
Type  | 
Default  | 
Flags  | 
Short Description  | 
|---|---|---|---|---|
  | 
  | 
d/r  | 
Amount of border space between the menubar shadow and the menu items   | 
|
  | 
d/r  | 
Style of bevel around the menubar   | 
Signals¶
- Inherited:
 Gtk.MenuShell (8), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Fields¶
- Inherited:
 Gtk.MenuShell (8), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Name  | 
Type  | 
Access  | 
Description  | 
|---|---|---|---|
menu_shell  | 
r  | 
Class Details¶
- class Gtk.MenuBar(**kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
The
Gtk.MenuBaris a subclass ofGtk.MenuShellwhich contains one or moreGtk.MenuItems. The result is a standard menu bar which can hold many menu items.- CSS nodes
 
Gtk.MenuBarhas a single CSS node with name menubar.- classmethod new()[source]¶
 - Returns:
 the new menu bar, as a
Gtk.Widget- Return type:
 
Creates a new
Gtk.MenuBar
- classmethod new_from_model(model)[source]¶
 - Parameters:
 model (
Gio.MenuModel) – aGio.MenuModel- Returns:
 a new
Gtk.MenuBar- Return type:
 
Creates a new
Gtk.MenuBarand populates it with menu items and submenus according to model.The created menu items are connected to actions found in the
Gtk.ApplicationWindowto which the menu bar belongs - typically by means of being contained within theGtk.ApplicationWindowswidget hierarchy.New in version 3.4.
- get_child_pack_direction()[source]¶
 - Returns:
 the child pack direction
- Return type:
 
Retrieves the current child pack direction of the menubar. See
Gtk.MenuBar.set_child_pack_direction().New in version 2.8.
- get_pack_direction()[source]¶
 - Returns:
 the pack direction
- Return type:
 
Retrieves the current pack direction of the menubar. See
Gtk.MenuBar.set_pack_direction().New in version 2.8.
- set_child_pack_direction(child_pack_dir)[source]¶
 - Parameters:
 child_pack_dir (
Gtk.PackDirection) – a newGtk.PackDirection
Sets how widgets should be packed inside the children of a menubar.
New in version 2.8.
- set_pack_direction(pack_dir)[source]¶
 - Parameters:
 pack_dir (
Gtk.PackDirection) – a newGtk.PackDirection
Sets how items should be packed inside a menubar.
New in version 2.8.
Property Details¶
- Gtk.MenuBar.props.child_pack_direction¶
 - Name:
 child-pack-direction- Type:
 - Default Value:
 - Flags:
 
The child pack direction of the menubar. It determines how the widgets contained in child menuitems are arranged.
New in version 2.8.
- Gtk.MenuBar.props.pack_direction¶
 - Name:
 pack-direction- Type:
 - Default Value:
 - Flags:
 
The pack direction of the menubar. It determines how menuitems are arranged in the menubar.
New in version 2.8.