Method

GtkMenuButtonset_menu_model

since: 3.6

Declaration [src]

void
gtk_menu_button_set_menu_model (
  GtkMenuButton* menu_button,
  GMenuModel* menu_model
)

Description [src]

Sets the GMenuModel from which the popup will be constructed, or NULL to dissociate any existing menu model and disable the button.

Depending on the value of GtkMenuButton:use-popover, either a GtkMenu will be created with gtk_menu_new_from_model(), or a GtkPopover with gtk_popover_new_from_model(). In either case, actions will be connected as documented for these functions.

If GtkMenuButton:popup or GtkMenuButton:popover are already set, those widgets are dissociated from the menu_button, and those properties are set to NULL.

Available since: 3.6

Parameters

menu_model

Type: GMenuModel

A GMenuModel, or NULL to unset and disable the button.

The argument can be NULL.
The data is owned by the caller of the method.