[gtk+/wip/colorchooser-v2: 74/84] gtk-demo: use the new GtkColorChooserDialog in the color demo
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/colorchooser-v2: 74/84] gtk-demo: use the new GtkColorChooserDialog in the color demo
- Date: Tue, 14 Feb 2012 19:11:03 +0000 (UTC)
commit 3a351c1ec5ad8a74f1243182f989f8b35a040330
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Feb 9 16:21:45 2012 -0500
gtk-demo: use the new GtkColorChooserDialog in the color demo
demos/gtk-demo/colorsel.c | 17 ++++-------------
1 files changed, 4 insertions(+), 13 deletions(-)
---
diff --git a/demos/gtk-demo/colorsel.c b/demos/gtk-demo/colorsel.c
index 8c3fe5e..633e13b 100644
--- a/demos/gtk-demo/colorsel.c
+++ b/demos/gtk-demo/colorsel.c
@@ -36,26 +36,17 @@ change_color_callback (GtkWidget *button,
{
GtkWidget *dialog;
GtkColorSelection *colorsel;
- GtkColorSelectionDialog *selection_dialog;
+ GtkColorChooserDialog *selection_dialog;
gint response;
- dialog = gtk_color_selection_dialog_new ("Changing color");
-
- gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
-
- selection_dialog = GTK_COLOR_SELECTION_DIALOG (dialog);
- colorsel = GTK_COLOR_SELECTION (gtk_color_selection_dialog_get_color_selection (selection_dialog));
-
- gtk_color_selection_set_previous_rgba (colorsel, &color);
- gtk_color_selection_set_current_rgba (colorsel, &color);
- gtk_color_selection_set_has_palette (colorsel, TRUE);
+ dialog = gtk_color_chooser_dialog_new ("Changing color", GTK_WINDOW (window));
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (dialog), &color);
response = gtk_dialog_run (GTK_DIALOG (dialog));
if (response == GTK_RESPONSE_OK)
{
- gtk_color_selection_get_current_rgba (colorsel, &color);
-
+ gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (dialog), &color);
gtk_widget_override_background_color (da, 0, &color);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]