![](gtk-logo.svg)

###  [ Gtk ](index.html)

API Version: 3.0

Library Version: 3.24

#####  Type

[ Dialog ](class.Dialog.html)

#####  Methods

[ add_action_widget ](method.Dialog.add_action_widget.html) [ add_button
](method.Dialog.add_button.html) [ add_buttons
](method.Dialog.add_buttons.html) [ get_action_area
](method.Dialog.get_action_area.html) [ get_content_area
](method.Dialog.get_content_area.html) [ get_header_bar
](method.Dialog.get_header_bar.html) [ get_response_for_widget
](method.Dialog.get_response_for_widget.html) [ get_widget_for_response
](method.Dialog.get_widget_for_response.html) [ response
](method.Dialog.response.html) [ run ](method.Dialog.run.html) [
set_alternative_button_order
](method.Dialog.set_alternative_button_order.html) [
set_alternative_button_order_from_array
](method.Dialog.set_alternative_button_order_from_array.html) [
set_default_response ](method.Dialog.set_default_response.html) [
set_response_sensitive ](method.Dialog.set_response_sensitive.html)

Generated by [ gi-docgen ](https://gitlab.gnome.org/GNOME/gi-docgen) 2023.4

###  Method

#  [ Gtk ](index.html) [ Dialog ](class.Dialog.html)
set_alternative_button_order

deprecated: 3.10  since: 2.6

####  Declaration  [ [src]
](https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtkdialog.h#L185 "go
to source location")

    
    
    void
    gtk_dialog_set_alternative_button_order (
      GtkDialog* dialog,
      gint first_response_id,
      ...
    )
    

`

####  Description  [ [src]
](https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtkdialog.c#L1553 "go
to source location")

Sets an alternative button order. If the ` GtkSettings: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 ](http://library.gnome.org/devel/hig-book/stable/)
with the affirmative button at the far right, and the cancel button left of
it. But the builtin  GTK  + dialogs and ` GtkMessageDialogs ` do provide an
alternative button order, which is more suitable on some platforms, e.g.
Windows.

Use this function after adding all the buttons to your dialog, as the
following example shows:

    
    
    cancel_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
                                           _("_Cancel"),
                                           GTK_RESPONSE_CANCEL);
    
    ok_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
                                       _("_OK"),
                                       GTK_RESPONSE_OK);
    
    gtk_widget_grab_default (ok_button);
    
    help_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
                                         _("_Help"),
                                         GTK_RESPONSE_HELP);
    
    gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
                                             GTK_RESPONSE_OK,
                                             GTK_RESPONSE_CANCEL,
                                             GTK_RESPONSE_HELP,
                                             -1);
    

Available since: 2.6

Deprecated since: 3.10

Deprecated.

This method is not directly available to language bindings.

####  Parameters

` first_response_id `

    

_Type:_ ` gint `

A response id used by one ` dialog ` ’s buttons.

` ... `

    

_Type:_ ` `

A list of more response ids of ` dialog ` ’s buttons, terminated by -1