Package: gtk
Class gtk:color-button
Superclassesgtk:widget, gobject:initially-unowned, gtk:accessible, gtk:buildable, gtk:constraint-target, gtk:color-chooser, gobject:object, common-lisp:standard-object, common-lisp:t Documented Subclasses
None
Direct SlotsThe modal property of type :boolean (Read / Write) Whether the color chooser dialog is modal. Default value: true The show-editor property of type :boolean (Read / Write) Set the property to true to skip the palette in the color chooser dialog and go directly to the color editor. This property should be used in cases where the palette in the editor would be redundant, such as when the color button is already part of a palette. Default value: false The title property of type :string (Read / Write) The title of the color chooser dialog. Default value: "Pick a Color" Details The gtk:color-button widget is a button which displays the currently
selected color and allows to open a color chooser dialog to change the
color.
It is a suitable widget for selecting a color in a preference dialog. ![]() CSS nodescolorbutton ╰── button.color ╰── [content]The gtk:color-button implementation has a single CSS node with name colorbutton which contains a button node. To differentiate it from a plain gtk:button widget, it gets the .color style class. Examples(defun do-color-button (&optional application) (let* ((button (make-instance 'gtk:color-button :rgba (gdk:rgba-parse "Blue") :title "Choose a color from the palette" :margin-top 48 :margin-bottom 48 :margin-start 48 :margin-end 48)) (window (make-instance 'gtk:window :title "Color Button" :application application :child button :default-width 270 :default-height 210))) (g:signal-connect button "color-set" (lambda (widget) (let ((rgba (gtk:color-chooser-rgba widget))) (format t "Selected color is ~a~%" (gdk:rgba-to-string rgba))))) (gtk:window-present window))) WarningSignal DetailsThe "activate" signallambda (button) :run-first
The "color-set" signallambda (button) :run-first
| Returned bySlot Access FunctionsInherited Slot Access FunctionsSee also |
2024-5-21