package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.gtk/Ocgtk_gtk/Gtk/Wrappers/Button/index.html
Module Wrappers.Button
type t = [ `button | `widget | `initially_unowned | `object_ ] Gobject.objval new_ : unit -> tCreate a new Button
val new_from_icon_name : string -> tCreate a new Button
val new_with_label : string -> tCreate a new Button
val new_with_mnemonic : string -> tCreate a new Button
val set_use_underline : t -> bool -> unitSets whether to use underlines as mnemonics.
If true, an underline in the text of the button label indicates the next character should be used for the mnemonic accelerator key.
val set_label : t -> string -> unitSets the text of the label of the button to @label.
This will also clear any previously set labels.
val set_icon_name : t -> string -> unitAdds a `GtkImage` with the given icon name as a child.
If @button already contains a child widget, that child widget will be removed and replaced with the image.
val set_has_frame : t -> bool -> unitSets the style of the button.
Buttons can have a flat appearance or have a frame drawn around them.
val set_child :
t ->
[ `widget | `initially_unowned | `object_ ] Gobject.obj option ->
unitSets the child widget of @button.
Note that by using this API, you take full responsibility for setting up the proper accessibility label and description information for @button. Most likely, you'll either set the accessibility label or description for @button explicitly, or you'll set a labelled-by or described-by relations from @child to @button.
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 icons and custom children, this function has no effect.
val get_use_underline : t -> boolgets whether underlines are interpreted as mnemonics.
See method@Gtk.Button.set_use_underline.
val get_label : t -> string optionFetches the text from the label of the button.
If the label text has not been set with method@Gtk.Button.set_label the return value will be %NULL. This will be the case if you create an empty button with ctor@Gtk.Button.new to use as a container.
val get_icon_name : t -> string optionReturns the icon name of the button.
If the icon name has not been set with method@Gtk.Button.set_icon_name the return value will be %NULL. This will be the case if you create an empty button with ctor@Gtk.Button.new to use as a container.
val get_has_frame : t -> boolReturns whether the button has a frame.
val get_child :
t ->
[ `widget | `initially_unowned | `object_ ] Gobject.obj optionGets the child widget of @button.
val get_can_shrink : t -> boolRetrieves whether the button can be smaller than the natural size of its contents.
val on_activate :
?after:bool ->
t ->
callback:(unit -> unit) ->
Gobject.Signal.handler_idval on_clicked :
?after:bool ->
t ->
callback:(unit -> unit) ->
Gobject.Signal.handler_id