From 4ac6730868c97e7cc800cee8eba6721a23181678 Mon Sep 17 00:00:00 2001 From: Lucas Rocha Date: Thu, 15 Dec 2005 05:40:15 +0000 Subject: add --hide-value to scale dialog. 2005-12-15 Lucas Rocha * src/option.c, src/scale.c, src/zenity.h: add --hide-value to scale dialog. --- src/option.c | 12 ++++++++++++ src/scale.c | 3 +++ src/zenity.h | 1 + 3 files changed, 16 insertions(+) (limited to 'src') diff --git a/src/option.c b/src/option.c index f3f26b3..2268ef7 100644 --- a/src/option.c +++ b/src/option.c @@ -98,6 +98,7 @@ static gint zenity_scale_min_value; static gint zenity_scale_max_value; static gint zenity_scale_step; static gboolean zenity_scale_print_partial; +static gboolean zenity_scale_hide_value; /* Miscelaneus Options */ static gboolean zenity_misc_about; @@ -718,6 +719,15 @@ static GOptionEntry scale_options[] = { N_("Print partial values"), NULL }, + { + "hide-value", + '\0', + 0, + G_OPTION_ARG_NONE, + &zenity_scale_hide_value, + N_("Hide value"), + NULL + }, { NULL } @@ -1002,6 +1012,7 @@ zenity_scale_pre_callback (GOptionContext *context, zenity_scale_max_value = 100; zenity_scale_step = 1; zenity_scale_print_partial = FALSE; + zenity_scale_hide_value = FALSE; return TRUE; } @@ -1343,6 +1354,7 @@ zenity_scale_post_callback (GOptionContext *context, results->scale_data->max_value = zenity_scale_max_value; results->scale_data->step = zenity_scale_step; results->scale_data->print_partial = zenity_scale_print_partial; + results->scale_data->hide_value = zenity_scale_hide_value; } return TRUE; diff --git a/src/scale.c b/src/scale.c index 228995e..cacb083 100644 --- a/src/scale.c +++ b/src/scale.c @@ -89,6 +89,9 @@ zenity_scale (ZenityData *data, ZenityScaleData *scale_data) g_signal_connect (G_OBJECT (scale), "value-changed", G_CALLBACK (zenity_scale_value_changed), data); + if (scale_data->hide_value) + gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE); + zenity_util_show_dialog (dialog); gtk_main (); } diff --git a/src/zenity.h b/src/zenity.h index 6b8cd29..6fb2b4c 100644 --- a/src/zenity.h +++ b/src/zenity.h @@ -67,6 +67,7 @@ typedef struct { gint max_value; gint step; gboolean print_partial; + gboolean hide_value; } ZenityScaleData; typedef struct { -- cgit v1.2.3-2-g168b