summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2010-09-14 20:09:43 +0200
committerJavier Jardón <jjardon@gnome.org>2010-09-15 04:00:55 +0200
commitf5a06df3dc0b21cd98afcec47bce085df6d7c4a3 (patch)
tree6fa84bf65855193ad7fbbde3b9a99bb97dcb7a5a /gtk
parent8345760fdb52c9ca4228b8faa27410fa78a122f9 (diff)
downloadgtk+-f5a06df3dc0b21cd98afcec47bce085df6d7c4a3.tar.gz
spinner: timeout should add/remove in map/unmap, not realize/unrealize.
Otherwise hiding the spinner won't stop it
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkspinner.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/gtk/gtkspinner.c b/gtk/gtkspinner.c
index 8bdf32bde9..a52b3c089b 100644
--- a/gtk/gtkspinner.c
+++ b/gtk/gtkspinner.c
@@ -71,8 +71,8 @@ struct _GtkSpinnerPrivate
};
static void gtk_spinner_dispose (GObject *gobject);
-static void gtk_spinner_realize (GtkWidget *widget);
-static void gtk_spinner_unrealize (GtkWidget *widget);
+static void gtk_spinner_map (GtkWidget *widget);
+static void gtk_spinner_unmap (GtkWidget *widget);
static gboolean gtk_spinner_expose (GtkWidget *widget,
GdkEventExpose *event);
static void gtk_spinner_screen_changed (GtkWidget *widget,
@@ -110,9 +110,9 @@ gtk_spinner_class_init (GtkSpinnerClass *klass)
gobject_class->set_property = gtk_spinner_set_property;
widget_class = GTK_WIDGET_CLASS(klass);
+ widget_class->map = gtk_spinner_map;
+ widget_class->unmap = gtk_spinner_unmap;
widget_class->expose_event = gtk_spinner_expose;
- widget_class->realize = gtk_spinner_realize;
- widget_class->unrealize = gtk_spinner_unrealize;
widget_class->screen_changed = gtk_spinner_screen_changed;
widget_class->style_set = gtk_spinner_style_set;
widget_class->get_accessible = gtk_spinner_get_accessible;
@@ -320,31 +320,27 @@ gtk_spinner_remove_timeout (GtkSpinner *spinner)
}
static void
-gtk_spinner_realize (GtkWidget *widget)
+gtk_spinner_map (GtkWidget *widget)
{
- GtkSpinnerPrivate *priv;
-
- priv = GTK_SPINNER (widget)->priv;
+ GtkSpinner *spinner = GTK_SPINNER (widget);
+ GtkSpinnerPrivate *priv = spinner->priv;
- GTK_WIDGET_CLASS (gtk_spinner_parent_class)->realize (widget);
+ GTK_WIDGET_CLASS (gtk_spinner_parent_class)->map (widget);
if (priv->active)
- gtk_spinner_add_timeout (GTK_SPINNER (widget));
+ gtk_spinner_add_timeout (spinner);
}
static void
-gtk_spinner_unrealize (GtkWidget *widget)
+gtk_spinner_unmap (GtkWidget *widget)
{
- GtkSpinnerPrivate *priv;
-
- priv = GTK_SPINNER (widget)->priv;
+ GtkSpinner *spinner = GTK_SPINNER (widget);
+ GtkSpinnerPrivate *priv = spinner->priv;
if (priv->timeout != 0)
- {
- gtk_spinner_remove_timeout (GTK_SPINNER (widget));
- }
+ gtk_spinner_remove_timeout (spinner);
- GTK_WIDGET_CLASS (gtk_spinner_parent_class)->unrealize (widget);
+ GTK_WIDGET_CLASS (gtk_spinner_parent_class)->unmap (widget);
}
static void