Package: gtk
Class gtk:message-dialog
Superclassesgtk:dialog, gtk:window, gtk:widget, gobject:initially-unowned, gtk:accessible, gtk:buildable, gtk:constraint-target, gtk:native, gtk:root, gtk:shortcut-manager, gobject:object, common-lisp:standard-object, common-lisp:t Documented Subclasses
None
Direct SlotsDetails The gtk:message-dialog widget presents a dialog with some message
text.
It is simply a convenience widget. You could construct the equivalent of a message dialog from a gtk:dialog widget without too much effort, but the gtk:message-dialog widget saves typing. ![]() The easiest way to do a modal message dialog is to use the :modal flag of the gtk:dialog-flags flags. The message dialog will prevent interaction with the parent window until it is hidden or destroyed. You can use the "response" signal to know when the user dismissed the message dialog. Examples(defun create-message-dialog-simple (parent) (let ((dialog (make-instance 'gtk:message-dialog :transient-for parent :modal t :message-type :info :buttons :ok :text "Message Dialog" :secondary-text "The secondary text."))) ;; Handler for the "response" signal of the dialog (g:signal-connect dialog "response" (lambda (dialog response) (gtk:window-destroy dialog))) (gtk:window-present dialog)))This is a variant that uses the gtk:message-dialog-new function. The first example is more lispy and the implementation more favorable. (defun create-message-dialog-simple2 (parent) (let ((dialog (gtk:message-dialog-new parent '(:modal) :info :ok-cancel "Message Dialog" parent))) ;; Set secondary text with the accessor (setf (gtk:message-dialog-secondary-text dialog) "Created with constructor and with two buttons.") ;; Handler for the "response" signal of the dialog (g:signal-connect dialog "response" (lambda (dialog response) (gtk:window-destroy dialog))) (gtk:window-present dialog))) GtkMessageDialog as GtkBuildableWarning | Returned bySlot Access Functions
Inherited Slot Access FunctionsSee also |
2025-2-26