summaryrefslogtreecommitdiff
path: root/src/text.c
diff options
context:
space:
mode:
authorArx Cruz <arxcruz@gnome.org>2011-07-26 14:00:28 -0300
committerArx Cruz <arxcruz@gnome.org>2011-07-26 14:02:45 -0300
commit6768a40e997697d05008aecdb41815e1dbae61c6 (patch)
tree787c080cb8b3a81af70d2bb7d9c3847529e9a5f1 /src/text.c
parent7a34df3041844918e2a0c5c44cb5601cff4c451a (diff)
Fix for bug #611297 Now Zenity have --ok-label and --cancel-label in all dialogs. This patch doesn't break old zenity scripts.
Diffstat (limited to 'src/text.c')
-rw-r--r--src/text.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/text.c b/src/text.c
index e786884..9c031cb 100644
--- a/src/text.c
+++ b/src/text.c
@@ -262,16 +262,22 @@ zenity_text (ZenityData *data, ZenityTextData *text_data)
if (text_data->editable)
zen_text_data->buffer = text_buffer;
- if (text_data->ok_label)
- gtk_button_set_label (GTK_BUTTON(ok_button), text_data->ok_label);
+ if (data->ok_label) {
+ gtk_button_set_label (GTK_BUTTON (ok_button), data->ok_label);
+ gtk_button_set_image (GTK_BUTTON (ok_button),
+ gtk_image_new_from_stock (GTK_STOCK_OK, GTK_ICON_SIZE_BUTTON));
+ }
- if (text_data->cancel_label)
- gtk_button_set_label (GTK_BUTTON(cancel_button), text_data->cancel_label);
+ if (data->cancel_label) {
+ gtk_button_set_label (GTK_BUTTON (cancel_button), data->cancel_label);
+ gtk_button_set_image (GTK_BUTTON (cancel_button),
+ gtk_image_new_from_stock (GTK_STOCK_CANCEL, GTK_ICON_SIZE_BUTTON));
+ }
if (text_data->checkbox) {
- gtk_widget_set_visible (GTK_WIDGET(checkbox), TRUE);
- gtk_widget_set_sensitive (GTK_WIDGET(ok_button), FALSE);
- gtk_button_set_label (GTK_BUTTON(checkbox), text_data->checkbox);
+ gtk_widget_set_visible (GTK_WIDGET (checkbox), TRUE);
+ gtk_widget_set_sensitive (GTK_WIDGET (ok_button), FALSE);
+ gtk_button_set_label (GTK_BUTTON (checkbox), text_data->checkbox);
g_signal_connect (G_OBJECT (checkbox), "toggled",
G_CALLBACK (zenity_text_toggle_button), ok_button);