Package: gtk

Function gtk:dialog-new-with-buttons

Lambda List

gtk:dialog-new-with-buttons (title parent flags &rest buttons)

Arguments

title -- a string with the title for the dialog, or nil
parent -- a gtk:window transient parent for the dialog, or nil
flags -- a gtk:dialog-flags value with the flags for the dialog
buttons -- pairs with a button text and the response ID for the button, which is a positive integer or a value of the gtk:response-type enumeration

Return Value

The new gtk:dialog widget.

Details

Creates a new dialog with title title, or nil for the default title, and transient parent parent, or nil for none. The flags argument can be used to make the dialog modal with the :modal flag of the gtk:dialog-flags flags and/or to have it destroyed along with its transient parent with the :destroy-with-parent flag.

After the flags argument, button text/response ID pairs should be listed. Button text can be arbitrary text. A response ID can be any positive number, or one of the values in the gtk:response-type enumeration. If the user clicks one of these dialog buttons, the gtk:dialog widget will emit the "response" signal with the corresponding response ID. If a gtk:dialog widget receives the "delete-event" signal, it will emit the "response" signal with a :delete-event response ID. However, destroying a dialog does not emit the "response" signal. So be careful relying on the "response" signal when using the :destroy-with-parent flag. Buttons are from left to right, so the first button in the list will be the leftmost button in the dialog.

Examples

(let ((dialog (gtk:dialog-new-with-buttons "My dialog"
                                           main-app-window
                                           '(:modal :destroy-with-parent)
                                           "_OK"
                                           :accept
                                           "_Cancel"
                                           :reject)))
  ... )    

Warning

The gtk:dialog implementation is deprecated since 4.10. Use the gtk:window widget instead.
 

See also

2024-8-16