From 6768a40e997697d05008aecdb41815e1dbae61c6 Mon Sep 17 00:00:00 2001 From: Arx Cruz Date: Tue, 26 Jul 2011 14:00:28 -0300 Subject: Fix for bug #611297 Now Zenity have --ok-label and --cancel-label in all dialogs. This patch doesn't break old zenity scripts. --- src/entry.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/entry.c') diff --git a/src/entry.c b/src/entry.c index d8111c04..7163e54c 100644 --- a/src/entry.c +++ b/src/entry.c @@ -53,6 +53,7 @@ zenity_entry (ZenityData *data, ZenityEntryData *entry_data) { GtkBuilder *builder = NULL; GtkWidget *dialog; + GtkWidget *button; GObject *text; GSList *entries = NULL; GSList *tmp; @@ -79,6 +80,20 @@ zenity_entry (ZenityData *data, ZenityEntryData *entry_data) if (data->width > -1 || data->height > -1) gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height); + + if (data->ok_label) { + button = GTK_WIDGET (gtk_builder_get_object (builder, "zenity_entry_ok_button")); + gtk_button_set_label (GTK_BUTTON (button), data->ok_label); + gtk_button_set_image (GTK_BUTTON (button), + gtk_image_new_from_stock (GTK_STOCK_OK, GTK_ICON_SIZE_BUTTON)); + } + + if (data->cancel_label) { + button = GTK_WIDGET (gtk_builder_get_object (builder, "zenity_entry_cancel_button")); + gtk_button_set_label (GTK_BUTTON (button), data->cancel_label); + gtk_button_set_image (GTK_BUTTON (button), + gtk_image_new_from_stock (GTK_STOCK_CANCEL, GTK_ICON_SIZE_BUTTON)); + } text = gtk_builder_get_object (builder, "zenity_entry_text"); -- cgit