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:
Matthias Clasen 2004-11-21 04:55:37 +00:00 committed by Matthias Clasen
parent 10592a4359
commit 6603a0868d
6 changed files with 70 additions and 0 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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);
}
}

View File

@ -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,