package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.gtk/Ocgtk_gtk/Gtk/Wrappers/Menu_button/index.html
Module Wrappers.Menu_button
type t = [ `menu_button | `widget | `initially_unowned | `object_ ] Gobject.objval new_ : unit -> tCreate a new MenuButton
val set_use_underline : t -> bool -> unitIf true, an underline in the text indicates a mnemonic.
val set_primary : t -> bool -> unitSets whether menu button acts as a primary menu.
Primary menus can be opened with the <kbd>F10</kbd> key.
val set_popover :
t ->
[ `widget | `initially_unowned | `object_ ] Gobject.obj option ->
unitSets the `GtkPopover` that will be popped up when the @menu_button is clicked.
If @popover is %NULL, the button is disabled.
If property@Gtk.MenuButton:menu-model is set, the menu model is dissociated from the @menu_button, and the property is set to %NULL.
Sets the `GMenuModel` from which the popup will be constructed.
If @menu_model is %NULL, the button is disabled.
A class@Gtk.Popover will be created from the menu model with ctor@Gtk.PopoverMenu.new_from_model. Actions will be connected as documented for this function.
If property@Gtk.MenuButton:popover is already set, it will be dissociated from the @menu_button, and the property is set to %NULL.
val set_label : t -> string -> unitSets the label to show inside the menu button.
Setting a label resets property@Gtk.MenuButton:icon-name and property@Gtk.MenuButton:child.
If property@Gtk.MenuButton:direction is not `GTK_ARROW_NONE`, a dropdown arrow will be shown next to the label.
val set_icon_name : t -> string -> unitSets the name of an icon to show inside the menu button.
Setting icon name resets property@Gtk.MenuButton:label and property@Gtk.MenuButton:child.
If property@Gtk.MenuButton:always-show-arrow is set to `TRUE` and property@Gtk.MenuButton:direction is not `GTK_ARROW_NONE`, a dropdown arrow will be shown next to the icon.
val set_has_frame : t -> bool -> unitSets the style of the button.
val set_direction : t -> Gtk_enums.arrowtype -> unitSets the direction in which the popup will be popped up.
If the button is automatically populated with an arrow icon, its direction will be changed to match.
If the does not fit in the available space in the given direction, GTK will its best to keep it inside the screen and fully visible.
If you pass %GTK_ARROW_NONE for a @direction, the popup will behave as if you passed %GTK_ARROW_DOWN (although you won’t see any arrows).
val set_child :
t ->
[ `widget | `initially_unowned | `object_ ] Gobject.obj option ->
unitSets the child widget of @menu_button.
Setting a child resets property@Gtk.MenuButton:label and property@Gtk.MenuButton:icon-name.
If property@Gtk.MenuButton:always-show-arrow is set to `TRUE` and property@Gtk.MenuButton:direction is not `GTK_ARROW_NONE`, a dropdown arrow will be shown next to the child.
val set_can_shrink : t -> bool -> unitSets whether the button size can be smaller than the natural size of its contents.
For text buttons, setting @can_shrink to true will ellipsize the label.
For icon buttons, this function has no effect.
val set_always_show_arrow : t -> bool -> unitSets whether to show a dropdown arrow even when using an icon or a custom child.
val set_active : t -> bool -> unitSets whether the menu button is active.
val popup : t -> unitPop up the menu.
val popdown : t -> unitDismiss the menu.
val get_use_underline : t -> boolReturns whether an embedded underline in the text indicates a mnemonic.
val get_primary : t -> boolReturns whether the menu button acts as a primary menu.
val get_popover :
t ->
[ `popover | `widget | `initially_unowned | `object_ ] Gobject.obj optionReturns the `GtkPopover` that pops out of the button.
If the button is not using a `GtkPopover`, this function returns %NULL.
Returns the `GMenuModel` used to generate the popup.
val get_label : t -> string optionGets the label shown in the button
val get_icon_name : t -> string optionGets the name of the icon shown in the button.
val get_has_frame : t -> boolReturns whether the button has a frame.
val get_direction : t -> Gtk_enums.arrowtypeReturns the direction the popup will be pointing at when popped up.
val get_child :
t ->
[ `widget | `initially_unowned | `object_ ] Gobject.obj optionGets the child widget of @menu_button.
val get_can_shrink : t -> boolRetrieves whether the button can be smaller than the natural size of its contents.
val get_always_show_arrow : t -> boolGets whether to show a dropdown arrow even when using an icon or a custom child.
val get_active : t -> boolReturns whether the menu button is active.
val on_activate :
?after:bool ->
t ->
callback:(unit -> unit) ->
Gobject.Signal.handler_id