/* Creates a color picker with the specified parameters */ static void create_cp (GtkWidget *table, int dither, int use_alpha, int left, int right, int top, int bottom) { GtkWidget *cp; cp = gnome_color_picker_new (); g_signal_connect (cp, "color_set", G_CALLBACK (color_set), NULL); gnome_color_picker_set_dither (GNOME_COLOR_PICKER (cp), dither); gnome_color_picker_set_use_alpha (GNOME_COLOR_PICKER (cp), use_alpha); gnome_color_picker_set_d (GNOME_COLOR_PICKER (cp), 1.0, 0.0, 1.0, 0.5); gtk_table_attach (GTK_TABLE (table), cp, left, right, top, bottom, 0, 0, 0, 0); gtk_widget_show (cp); }
/* * Sets the properties of the widget. This is used for both applying the * properties changed in the property editor, and also for loading. */ static void gb_gnome_color_picker_set_properties (GtkWidget * widget, GbWidgetSetArgData * data) { gboolean dither, use_alpha, focus_on_click; gchar *title; dither = gb_widget_input_bool (data, Dither); if (data->apply) gnome_color_picker_set_dither (GNOME_COLOR_PICKER (widget), dither); use_alpha = gb_widget_input_bool (data, UseAlpha); if (data->apply) gnome_color_picker_set_use_alpha (GNOME_COLOR_PICKER (widget), use_alpha); title = gb_widget_input_string (data, Title); if (data->apply) gnome_color_picker_set_title (GNOME_COLOR_PICKER (widget), title); focus_on_click = gb_widget_input_bool (data, FocusOnClick); if (data->apply) gtk_button_set_focus_on_click (GTK_BUTTON (widget), focus_on_click); }