mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 05:01:09 +00:00
Provide a non-varargs variant of gtk_dialog_set_alternative_button_order()
2004-11-20 Matthias Clasen <mclasen@redhat.com> * gtk/gtkdialog.h: * gtk/gtkdialog.c (gtk_dialog_set_alternative_button_order_from_array): Provide a non-varargs variant of gtk_dialog_set_alternative_button_order() for language bindings. (#158798, John Finlay)
This commit is contained in:
parent
10592a4359
commit
6603a0868d
@ -1,3 +1,10 @@
|
|||||||
|
2004-11-20 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkdialog.h:
|
||||||
|
* gtk/gtkdialog.c (gtk_dialog_set_alternative_button_order_from_array):
|
||||||
|
Provide a non-varargs variant of gtk_dialog_set_alternative_button_order()
|
||||||
|
for language bindings. (#158798, John Finlay)
|
||||||
|
|
||||||
2004-11-20 Federico Mena Quintero <federico@ximian.com>
|
2004-11-20 Federico Mena Quintero <federico@ximian.com>
|
||||||
|
|
||||||
Merged from gtk-2-4:
|
Merged from gtk-2-4:
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2004-11-20 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkdialog.h:
|
||||||
|
* gtk/gtkdialog.c (gtk_dialog_set_alternative_button_order_from_array):
|
||||||
|
Provide a non-varargs variant of gtk_dialog_set_alternative_button_order()
|
||||||
|
for language bindings. (#158798, John Finlay)
|
||||||
|
|
||||||
2004-11-20 Federico Mena Quintero <federico@ximian.com>
|
2004-11-20 Federico Mena Quintero <federico@ximian.com>
|
||||||
|
|
||||||
Merged from gtk-2-4:
|
Merged from gtk-2-4:
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2004-11-20 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkdialog.h:
|
||||||
|
* gtk/gtkdialog.c (gtk_dialog_set_alternative_button_order_from_array):
|
||||||
|
Provide a non-varargs variant of gtk_dialog_set_alternative_button_order()
|
||||||
|
for language bindings. (#158798, John Finlay)
|
||||||
|
|
||||||
2004-11-20 Federico Mena Quintero <federico@ximian.com>
|
2004-11-20 Federico Mena Quintero <federico@ximian.com>
|
||||||
|
|
||||||
Merged from gtk-2-4:
|
Merged from gtk-2-4:
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2004-11-20 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkdialog.h:
|
||||||
|
* gtk/gtkdialog.c (gtk_dialog_set_alternative_button_order_from_array):
|
||||||
|
Provide a non-varargs variant of gtk_dialog_set_alternative_button_order()
|
||||||
|
for language bindings. (#158798, John Finlay)
|
||||||
|
|
||||||
2004-11-20 Federico Mena Quintero <federico@ximian.com>
|
2004-11-20 Federico Mena Quintero <federico@ximian.com>
|
||||||
|
|
||||||
Merged from gtk-2-4:
|
Merged from gtk-2-4:
|
||||||
|
@ -1185,4 +1185,43 @@ gtk_dialog_set_alternative_button_order (GtkDialog *dialog,
|
|||||||
args);
|
args);
|
||||||
va_end (args);
|
va_end (args);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* gtk_dialog_set_alternative_button_order_from_array:
|
||||||
|
* @dialog: a #GtkDialog
|
||||||
|
* @n_params: the number of response ids in @new_order
|
||||||
|
* @new_order: an array of response ids of @dialog's buttons
|
||||||
|
*
|
||||||
|
* 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 in @new_order.
|
||||||
|
*
|
||||||
|
* See gtk_dialog_set_alternative_button_order() for more information.
|
||||||
|
*
|
||||||
|
* This function is for use by language bindings.
|
||||||
|
*
|
||||||
|
* Since: 2.6
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
|
||||||
|
gint n_params,
|
||||||
|
gint *new_order)
|
||||||
|
{
|
||||||
|
GdkScreen *screen;
|
||||||
|
GtkWidget *child;
|
||||||
|
gint position;
|
||||||
|
|
||||||
|
g_return_if_fail (GTK_IS_DIALOG (dialog));
|
||||||
|
g_return_if_fail (new_order != NULL);
|
||||||
|
|
||||||
|
screen = gtk_widget_get_screen (GTK_WIDGET (dialog));
|
||||||
|
if (!gtk_alternative_dialog_button_order (screen))
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (position = 0; position < n_params; position++)
|
||||||
|
{
|
||||||
|
/* reorder child with response_id to position */
|
||||||
|
child = dialog_find_button (dialog, new_order[position]);
|
||||||
|
gtk_box_reorder_child (GTK_BOX (dialog->action_area), child, position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -156,6 +156,9 @@ gboolean gtk_alternative_dialog_button_order (GdkScreen *screen);
|
|||||||
void gtk_dialog_set_alternative_button_order (GtkDialog *dialog,
|
void gtk_dialog_set_alternative_button_order (GtkDialog *dialog,
|
||||||
gint first_response_id,
|
gint first_response_id,
|
||||||
...);
|
...);
|
||||||
|
void gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
|
||||||
|
gint n_params,
|
||||||
|
gint *new_order);
|
||||||
|
|
||||||
/* Emit response signal */
|
/* Emit response signal */
|
||||||
void gtk_dialog_response (GtkDialog *dialog,
|
void gtk_dialog_response (GtkDialog *dialog,
|
||||||
|
Loading…
Reference in New Issue
Block a user