SuperclassesDocumented SubclassesDirect Slotsalways-show-imageThe always-show-image property of type :boolean (Read / Write / Construct) If true, the button will ignore the gtk-button-images setting and always show the image, if
available. Use this property if the button would be useless or hard to use without the image. Default value: false focus-on-clickThe focus-on-click property of type :boolean (Read / Write) Whether the button grabs focus when it is clicked with the mouse. Default value: true imageThe image property of type gtk:widget (Read / Write) The child widget to appear next to the button text. image-positionThe image-position property of type gtk:position-type (Read / Write) The position of the image relative to the text inside the button. Default value: :left labelThe label property of type :string (Read / Write / Construct) The text of the label inside the button, if the button contains a label. Default value: nil use-stockThe use-stock property of type :boolean (Read / Write / Construct)
If set, the label is used to pick a stock item instead of being displayed. Warning: The use-stock property has been deprecated since version 3.10 and should not be used in newly written code. Default value: false use-underlineThe use-underline property of type :boolean (Read / Write / Construct)
If set, an underline in the text indicates the next character should be used for the mnemonic accelerator key. Default value: false xalignThe xalign property of type :float (Read / Write) If the child of the button is a gtk:misc or gtk:alignment
widget, this property can be used to control its horizontal alignment. The value 0.0 is left aligned, 1.0 is right aligned. Warning: The xalign property has been deprecated since version
3.14 and should not be used in newly written code. Access the child widget directly if you need to control its alignment. Allowed values: [0,1] Default value: 0.5 yalignThe yalign property of type :float (Read / Write) If the child of the button is a gtk:misc or gtk:alignment
widget, this property can be used to control its vertical alignment. The value 0.0 is top aligned, 1.0 is bottom aligned. Warning: The yalign property has been deprecated since version
3.14 and should not be used in newly written code. Access the child widget directly if you need to control its alignment. Allowed values: [0,1] Default value: 0.5 Details The gtk:button widget emits a signal when clicked on.  Figure: GtkButton The gtk:button widget is generally used to trigger a callback function
that is called when the button is pressed. The various signals and how to use
them are outlined below. The gtk:button widget can hold any valid child widget. That is, it can hold almost any other standard gtk:widget object. The most commonly used child is the gtk:label widget. CSS nodes The gtk:button implementation has a single CSS node with name button. The node will get the .image-button or .text-button style classes, if the content is just an image or label, respectively. It may also receive the .flat style class. Other style classes that are commonly used with the gtk:button widget include .suggested-action and .destructive-action. In special cases, buttons can be made round by adding the .circular
style class. Button-like widgets like gtk:toggle-button, gtk:menu-button, gtk:volume-button, gtk:lock-button, gtk:color-button, gtk:font-button or gtk:file-chooser-button use style classes such as .toggle, .popup, .scale, .lock, .color, .font, .file to differentiate themselves from a plain gtk:button
widget. Style Property Details Signal Details |
| Returned bySlot Access FunctionsInherited Slot Access FunctionsSee also |