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 of the dialog, or nil
parent -- a gtk-window transient parent of the dialog, or nil
flags -- a list of flags of type gtk-dialog-flags
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

A new gtk-dialog widget.

Details

Creates a new dialog with title title, or nil for the default title, see the gtk-window-title function, and transient parent parent, or nil for none, see the gtk-window-transient-for function. 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)))
  ... )    
 

See also

2021-9-26