Package: gtk

Accessor gtk:button-child

Lambda List

gtk:button-child (object)

Syntax

(gtk:button-child object) => child
(setf (gtk:button-child object) child)

Arguments

object -- a gtk:button widget
child -- a gtk:widget child widget

Details

The accessor for the child slot of the gtk:button class gets or sets the child widget of the button.

Note that by using this API, you take full responsibility for setting up the proper accessibility label and description information for the button. Most likely, you will either set the accessibility label or description for the button explicitly, or you will set a labelled-by or described-by relations from the child widget to the button.

Examples

Get the text of the label from the button:
(defvar button (gtk:button-new-with-label "Save"))
=> BUTTON
(gtk:label-label (gtk:button-child button))
=> "Save"    
Create a button with an image and a label:
(defvar button (gtk:button-new))
=> BUTTON
(defvar box (gtk:box-new :horizontal 9))
=> BOX
(gtk:box-append box (make-instance 'gtk:image :icon-name "edit-clear"))
(gtk:box-append box (make-instance 'gtk:label :label "Edit Clear"))
(setf (gtk:button-child button) box)
=> #<GTK:BOX {1003471C73}>    
 

See also

2025-08-05