Commit 0016d9ed authored by Sven Neumann's avatar Sven Neumann
Browse files

Emit a "toggled" signal.


--Sven
parent b53273ea
2000-08-28 Sven Neumann <sven@gimp.org>
* libgimp/gimpchainbutton.[ch]: emit a "toggled" signal. This
is rarely useful since in most cases you want to connect to
the "changed" signal of the attached size_entries since you can
not know otherwise which of the attached entries needs to be
adjusted. Providing the signal is good style nevertheless.
2000-08-27 Michael Natterer <mitch@gimp.org>
 
* libgimp/gimp.c: NULL is the default log domain, not "".
......
......@@ -59,8 +59,17 @@ static gint gimp_chain_button_draw_lines (GtkWidget *widget,
GdkEventExpose *eevent,
GimpChainButton *gcb);
enum
{
TOGGLED,
LAST_SIGNAL
};
static guint gimp_chain_button_signals[LAST_SIGNAL] = { 0 };
static GtkTableClass *parent_class = NULL;
static void
gimp_chain_button_destroy (GtkObject *object)
{
......@@ -95,6 +104,19 @@ gimp_chain_button_class_init (GimpChainButtonClass *class)
object_class->destroy = gimp_chain_button_destroy;
gimp_chain_button_signals[TOGGLED] =
gtk_signal_new ("toggled",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpChainButtonClass,
toggled),
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, gimp_chain_button_signals,
LAST_SIGNAL);
class->toggled = NULL;
widget_class->realize = gimp_chain_button_realize;
}
......@@ -306,6 +328,8 @@ gimp_chain_button_clicked_callback (GtkWidget *widget,
gtk_pixmap_set (GTK_PIXMAP(gcb->pixmap), gcb->chain, gcb->chain_mask);
else
gtk_pixmap_set (GTK_PIXMAP(gcb->pixmap), gcb->broken, gcb->broken_mask);
gtk_signal_emit (GTK_OBJECT (gcb), gimp_chain_button_signals[TOGGLED]);
}
static gint
......
......@@ -72,7 +72,9 @@ struct _GimpChainButton
struct _GimpChainButtonClass
{
GtkButtonClass parent_class;
GtkTableClass parent_class;
void (* toggled) (GimpChainButton *gcb);
};
......
......@@ -59,8 +59,17 @@ static gint gimp_chain_button_draw_lines (GtkWidget *widget,
GdkEventExpose *eevent,
GimpChainButton *gcb);
enum
{
TOGGLED,
LAST_SIGNAL
};
static guint gimp_chain_button_signals[LAST_SIGNAL] = { 0 };
static GtkTableClass *parent_class = NULL;
static void
gimp_chain_button_destroy (GtkObject *object)
{
......@@ -95,6 +104,19 @@ gimp_chain_button_class_init (GimpChainButtonClass *class)
object_class->destroy = gimp_chain_button_destroy;
gimp_chain_button_signals[TOGGLED] =
gtk_signal_new ("toggled",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpChainButtonClass,
toggled),
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, gimp_chain_button_signals,
LAST_SIGNAL);
class->toggled = NULL;
widget_class->realize = gimp_chain_button_realize;
}
......@@ -306,6 +328,8 @@ gimp_chain_button_clicked_callback (GtkWidget *widget,
gtk_pixmap_set (GTK_PIXMAP(gcb->pixmap), gcb->chain, gcb->chain_mask);
else
gtk_pixmap_set (GTK_PIXMAP(gcb->pixmap), gcb->broken, gcb->broken_mask);
gtk_signal_emit (GTK_OBJECT (gcb), gimp_chain_button_signals[TOGGLED]);
}
static gint
......
......@@ -72,7 +72,9 @@ struct _GimpChainButton
struct _GimpChainButtonClass
{
GtkButtonClass parent_class;
GtkTableClass parent_class;
void (* toggled) (GimpChainButton *gcb);
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment