60
58
GimpColorHexEntry *entry);
63
static guint entry_signals[LAST_SIGNAL] = { 0 };
67
gimp_color_hex_entry_get_type (void)
69
static GType entry_type = 0;
73
static const GTypeInfo entry_info =
75
sizeof (GimpColorHexEntryClass),
77
(GBaseFinalizeFunc) NULL,
78
(GClassInitFunc) gimp_color_hex_entry_class_init,
79
NULL, /* class_finalize */
80
NULL, /* class_data */
81
sizeof (GimpColorHexEntry),
83
(GInstanceInitFunc) gimp_color_hex_entry_init,
86
entry_type = g_type_register_static (GTK_TYPE_ENTRY,
61
G_DEFINE_TYPE (GimpColorHexEntry, gimp_color_hex_entry, GTK_TYPE_ENTRY)
63
#define parent_class gimp_color_hex_entry_parent_class
65
static guint entry_signals[LAST_SIGNAL] = { 0 };
95
69
gimp_color_hex_entry_class_init (GimpColorHexEntryClass *klass)
97
71
entry_signals[COLOR_CHANGED] =
98
g_signal_new ("color_changed",
72
g_signal_new ("color-changed",
99
73
G_TYPE_FROM_CLASS (klass),
100
74
G_SIGNAL_RUN_FIRST,
101
75
G_STRUCT_OFFSET (GimpColorHexEntryClass, color_changed),
156
130
gtk_entry_set_text (GTK_ENTRY (entry), "000000");
158
g_signal_connect (entry, "focus_out_event",
132
g_signal_connect (entry, "focus-out-event",
159
133
G_CALLBACK (gimp_color_hex_entry_events),
161
g_signal_connect (entry, "key_press_event",
135
g_signal_connect (entry, "key-press-event",
162
136
G_CALLBACK (gimp_color_hex_entry_events),
165
g_signal_connect (completion, "match_selected",
139
g_signal_connect (completion, "match-selected",
166
140
G_CALLBACK (gimp_color_hex_entry_matched),
186
160
* @color: pointer to a #GimpRGB
188
162
* Sets the color displayed by a #GimpColorHexEntry. If the new color
189
* is different to the previously set color, the "color_changed"
163
* is different to the previously set color, the "color-changed"
190
164
* signal is emitted.
192
166
* Since: GIMP 2.2