Package: gtk
Class gtk:alert-dialog
Superclassesgobject:object, common-lisp:standard-object, common-lisp:t Documented Subclasses
None
Direct SlotsDetails The gtk:alert-dialog object collects the arguments that are needed
to present a message to the user. The message is shown with the gtk:alert-dialog-choose function. This API
follows the GIO async pattern, and the result can be obtained by calling the gtk:alert-dialog-choose-finish function. If you do not need to wait for a button to be clicked, you can use the gtk:alert-dialog-show function. Since 4.10 Examples
(defun create-alert-dialog (parent)
(let ((dialog (make-instance 'gtk:alert-dialog
:message "Alert"
:detail "The detail of the alert dialog."
:buttons '("Cancel" "OK")
:cancel-button 0
:default-button 1
:modal t))
(cancellable (g:cancellable-new)))
;; Cancel alert dialog after waiting 10 seconds for user response
(g:timeout-add-seconds 10
(lambda ()
(g:cancellable-cancel cancellable)
glib:+source-remove+))
;; Show alert dialog
(gtk:alert-dialog-choose dialog
parent
cancellable
;; The GAsyncReadyCallback function
(lambda (source result)
;; Get the result
(let ((result (gtk:alert-dialog-choose-finish source result)))
(format t "Alert dialog result is ~a~%" result)))))) | Inherited Slot Access FunctionsSee also |
2025-04-17