Package: gtk

Function gtk-dialog-set-alternative-button-order

Lambda List

gtk-dialog-set-alternative-button-order (dialog response)

Arguments

dialog -- a gtk-dialog widget
response -- a list of response IDs, which are positive integer or values of the gtk-response-type enumeration

Details

Sets an alternative button order. If the gtk-alternative-button-order setting is set to true, the dialog buttons are reordered according to the order of the response IDs passed to this function.

By default, GTK dialogs use the button order advocated by the GNOME Human Interface Guidelines with the affirmative button at the far right, and the cancel button left of it. But the built-in GTK dialogs and message dialogs do provide an alternative button order, which is more suitable on some platforms, e.g. Windows.

Examples

Use this function after adding all the buttons to your dialog, as the following example shows:
(let (;; Create a dialog with three buttons
      (dialog (gtk-dialog-new-with-buttons "Demo Dialog"
                                           nil ; No Parent window
                                           '(:modal)
                                           "gtk-cancel"
                                           :cancel
                                           "gtk-ok"
                                           :ok
                                           "gtk-apply"
                                           :apply)))
  ;; Set the default button.
  (gtk-widget-grab-default (gtk-dialog-widget-for-response dialog :ok))
  ;; Allow alternative button order for the default screen.
  (setf (gtk-settings-gtk-alternative-button-order
            (gtk-settings-default))
        t)
  ;; Set the alternative button order.
  (gtk-dialog-set-alternative-button-order dialog '(:ok :cancel :apply))
  ...)    

Warning

The gtk-dialog-set-alternative-button-order function has been deprecated since version 3.10 and should not be used in newly written code.
 

See also

2021-9-26