[gtk+/wip/colorchooser-v2: 38/84] testcolorchooser: Add more options
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/colorchooser-v2: 38/84] testcolorchooser: Add more options
- Date: Tue, 14 Feb 2012 19:08:01 +0000 (UTC)
commit 2d25e3c9a6aa9d6259310cc3deb9630b81d0fb85
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Feb 3 23:45:24 2012 -0500
testcolorchooser: Add more options
Add a --edit option that brings the color chooser up in
single-color edit mode right away.
tests/testcolorchooser.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/tests/testcolorchooser.c b/tests/testcolorchooser.c
index 9c67bcd..76005e5 100644
--- a/tests/testcolorchooser.c
+++ b/tests/testcolorchooser.c
@@ -34,15 +34,26 @@ int
main (int argc, char *argv[])
{
GtkWidget *dialog;
+ gint i;
gtk_init (NULL, NULL);
dialog = gtk_color_chooser_dialog_new ("Select a color", NULL);
- if (argc > 1 && g_strcmp0 (argv[1], "--no-alpha") == 0)
+
+ for (i = 1; i < argc; i++)
{
- g_print ("turning alpha off\n");
- gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER (dialog), FALSE);
+ if (g_strcmp0 (argv[i], "--no-alpha") == 0)
+ {
+ g_print ("turning alpha off\n");
+ gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER (dialog), FALSE);
+ }
+ else if (g_strcmp0 (argv[i], "--edit") == 0)
+ {
+ g_print ("starting in edit mode\n");
+ g_object_set (dialog, "show-editor", TRUE, NULL);
+ }
}
+
g_signal_connect (dialog, "notify::color", G_CALLBACK (color_changed), NULL);
g_signal_connect (dialog, "response", G_CALLBACK (dialog_response), NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]