hook up the destroy handler. (gtk_expander_destroy),
2003-10-28 Mark McLoughlin <mark@skynet.ie> * gtk/gtkexpander.c: (gtk_expander_class_init): hook up the destroy handler. (gtk_expander_destroy), (gtk_expander_unrealize): remove the expand/collapse timeout on destroy instead of unrealize to avoid leaving the expander in a inconsistent state when unrealizing during animation. (gtk_expander_start_animation): remove realized check. (gtk_expander_set_expanded): if the widget isn't realized, expand immediately.
This commit is contained in:
committed by
Mark McLoughlin
parent
5f9345d829
commit
6ccf2d2d09
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
|||||||
|
2003-10-28 Mark McLoughlin <mark@skynet.ie>
|
||||||
|
|
||||||
|
* gtk/gtkexpander.c:
|
||||||
|
(gtk_expander_class_init): hook up the destroy handler.
|
||||||
|
(gtk_expander_destroy), (gtk_expander_unrealize):
|
||||||
|
remove the expand/collapse timeout on destroy instead
|
||||||
|
of unrealize to avoid leaving the expander in a inconsistent
|
||||||
|
state when unrealizing during animation.
|
||||||
|
(gtk_expander_start_animation): remove realized check.
|
||||||
|
(gtk_expander_set_expanded): if the widget isn't realized,
|
||||||
|
expand immediately.
|
||||||
|
|
||||||
Tue Oct 28 09:44:16 2003 Owen Taylor <otaylor@redhat.com>
|
Tue Oct 28 09:44:16 2003 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkxembed.c (_gtk_xembed_send_focus_message): Silently
|
* gtk/gtkxembed.c (_gtk_xembed_send_focus_message): Silently
|
||||||
|
|||||||
@ -1,3 +1,15 @@
|
|||||||
|
2003-10-28 Mark McLoughlin <mark@skynet.ie>
|
||||||
|
|
||||||
|
* gtk/gtkexpander.c:
|
||||||
|
(gtk_expander_class_init): hook up the destroy handler.
|
||||||
|
(gtk_expander_destroy), (gtk_expander_unrealize):
|
||||||
|
remove the expand/collapse timeout on destroy instead
|
||||||
|
of unrealize to avoid leaving the expander in a inconsistent
|
||||||
|
state when unrealizing during animation.
|
||||||
|
(gtk_expander_start_animation): remove realized check.
|
||||||
|
(gtk_expander_set_expanded): if the widget isn't realized,
|
||||||
|
expand immediately.
|
||||||
|
|
||||||
Tue Oct 28 09:44:16 2003 Owen Taylor <otaylor@redhat.com>
|
Tue Oct 28 09:44:16 2003 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkxembed.c (_gtk_xembed_send_focus_message): Silently
|
* gtk/gtkxembed.c (_gtk_xembed_send_focus_message): Silently
|
||||||
|
|||||||
@ -1,3 +1,15 @@
|
|||||||
|
2003-10-28 Mark McLoughlin <mark@skynet.ie>
|
||||||
|
|
||||||
|
* gtk/gtkexpander.c:
|
||||||
|
(gtk_expander_class_init): hook up the destroy handler.
|
||||||
|
(gtk_expander_destroy), (gtk_expander_unrealize):
|
||||||
|
remove the expand/collapse timeout on destroy instead
|
||||||
|
of unrealize to avoid leaving the expander in a inconsistent
|
||||||
|
state when unrealizing during animation.
|
||||||
|
(gtk_expander_start_animation): remove realized check.
|
||||||
|
(gtk_expander_set_expanded): if the widget isn't realized,
|
||||||
|
expand immediately.
|
||||||
|
|
||||||
Tue Oct 28 09:44:16 2003 Owen Taylor <otaylor@redhat.com>
|
Tue Oct 28 09:44:16 2003 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkxembed.c (_gtk_xembed_send_focus_message): Silently
|
* gtk/gtkxembed.c (_gtk_xembed_send_focus_message): Silently
|
||||||
|
|||||||
@ -1,3 +1,15 @@
|
|||||||
|
2003-10-28 Mark McLoughlin <mark@skynet.ie>
|
||||||
|
|
||||||
|
* gtk/gtkexpander.c:
|
||||||
|
(gtk_expander_class_init): hook up the destroy handler.
|
||||||
|
(gtk_expander_destroy), (gtk_expander_unrealize):
|
||||||
|
remove the expand/collapse timeout on destroy instead
|
||||||
|
of unrealize to avoid leaving the expander in a inconsistent
|
||||||
|
state when unrealizing during animation.
|
||||||
|
(gtk_expander_start_animation): remove realized check.
|
||||||
|
(gtk_expander_set_expanded): if the widget isn't realized,
|
||||||
|
expand immediately.
|
||||||
|
|
||||||
Tue Oct 28 09:44:16 2003 Owen Taylor <otaylor@redhat.com>
|
Tue Oct 28 09:44:16 2003 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkxembed.c (_gtk_xembed_send_focus_message): Silently
|
* gtk/gtkxembed.c (_gtk_xembed_send_focus_message): Silently
|
||||||
|
|||||||
@ -1,3 +1,15 @@
|
|||||||
|
2003-10-28 Mark McLoughlin <mark@skynet.ie>
|
||||||
|
|
||||||
|
* gtk/gtkexpander.c:
|
||||||
|
(gtk_expander_class_init): hook up the destroy handler.
|
||||||
|
(gtk_expander_destroy), (gtk_expander_unrealize):
|
||||||
|
remove the expand/collapse timeout on destroy instead
|
||||||
|
of unrealize to avoid leaving the expander in a inconsistent
|
||||||
|
state when unrealizing during animation.
|
||||||
|
(gtk_expander_start_animation): remove realized check.
|
||||||
|
(gtk_expander_set_expanded): if the widget isn't realized,
|
||||||
|
expand immediately.
|
||||||
|
|
||||||
Tue Oct 28 09:44:16 2003 Owen Taylor <otaylor@redhat.com>
|
Tue Oct 28 09:44:16 2003 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkxembed.c (_gtk_xembed_send_focus_message): Silently
|
* gtk/gtkxembed.c (_gtk_xembed_send_focus_message): Silently
|
||||||
|
|||||||
@ -75,6 +75,8 @@ static void gtk_expander_get_property (GObject *object,
|
|||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
|
static void gtk_expander_destroy (GtkObject *object);
|
||||||
|
|
||||||
static void gtk_expander_realize (GtkWidget *widget);
|
static void gtk_expander_realize (GtkWidget *widget);
|
||||||
static void gtk_expander_unrealize (GtkWidget *widget);
|
static void gtk_expander_unrealize (GtkWidget *widget);
|
||||||
static void gtk_expander_size_request (GtkWidget *widget,
|
static void gtk_expander_size_request (GtkWidget *widget,
|
||||||
@ -145,18 +147,22 @@ static void
|
|||||||
gtk_expander_class_init (GtkExpanderClass *klass)
|
gtk_expander_class_init (GtkExpanderClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
GtkObjectClass *object_class;
|
||||||
GtkWidgetClass *widget_class;
|
GtkWidgetClass *widget_class;
|
||||||
GtkContainerClass *container_class;
|
GtkContainerClass *container_class;
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (klass);
|
parent_class = g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
object_class = (GtkObjectClass *) klass;
|
||||||
widget_class = (GtkWidgetClass *) klass;
|
widget_class = (GtkWidgetClass *) klass;
|
||||||
container_class = (GtkContainerClass *) klass;
|
container_class = (GtkContainerClass *) klass;
|
||||||
|
|
||||||
gobject_class->set_property = gtk_expander_set_property;
|
gobject_class->set_property = gtk_expander_set_property;
|
||||||
gobject_class->get_property = gtk_expander_get_property;
|
gobject_class->get_property = gtk_expander_get_property;
|
||||||
|
|
||||||
|
object_class->destroy = gtk_expander_destroy;
|
||||||
|
|
||||||
widget_class->realize = gtk_expander_realize;
|
widget_class->realize = gtk_expander_realize;
|
||||||
widget_class->unrealize = gtk_expander_unrealize;
|
widget_class->unrealize = gtk_expander_unrealize;
|
||||||
widget_class->size_request = gtk_expander_size_request;
|
widget_class->size_request = gtk_expander_size_request;
|
||||||
@ -338,6 +344,20 @@ gtk_expander_get_property (GObject *object,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gtk_expander_destroy (GtkObject *object)
|
||||||
|
{
|
||||||
|
GtkExpanderPrivate *priv = GTK_EXPANDER (object)->priv;
|
||||||
|
|
||||||
|
if (priv->animation_timeout)
|
||||||
|
{
|
||||||
|
g_source_remove (priv->animation_timeout);
|
||||||
|
priv->animation_timeout = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_expander_realize (GtkWidget *widget)
|
gtk_expander_realize (GtkWidget *widget)
|
||||||
{
|
{
|
||||||
@ -388,12 +408,6 @@ gtk_expander_unrealize (GtkWidget *widget)
|
|||||||
priv->event_window = NULL;
|
priv->event_window = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->animation_timeout)
|
|
||||||
{
|
|
||||||
g_source_remove (priv->animation_timeout);
|
|
||||||
priv->animation_timeout = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
|
GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1176,9 +1190,6 @@ gtk_expander_start_animation (GtkExpander *expander)
|
|||||||
{
|
{
|
||||||
GtkExpanderPrivate *priv = expander->priv;
|
GtkExpanderPrivate *priv = expander->priv;
|
||||||
|
|
||||||
if (!GTK_WIDGET_REALIZED (expander))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (priv->animation_timeout)
|
if (priv->animation_timeout)
|
||||||
g_source_remove (priv->animation_timeout);
|
g_source_remove (priv->animation_timeout);
|
||||||
|
|
||||||
@ -1215,16 +1226,21 @@ gtk_expander_set_expanded (GtkExpander *expander,
|
|||||||
{
|
{
|
||||||
priv->expanded = expanded;
|
priv->expanded = expanded;
|
||||||
|
|
||||||
if (GTK_WIDGET_VISIBLE (expander))
|
if (GTK_WIDGET_REALIZED (expander))
|
||||||
|
{
|
||||||
gtk_expander_start_animation (expander);
|
gtk_expander_start_animation (expander);
|
||||||
|
}
|
||||||
else if (GTK_BIN (expander)->child)
|
else
|
||||||
{
|
{
|
||||||
priv->expander_style = expanded ? GTK_EXPANDER_EXPANDED :
|
priv->expander_style = expanded ? GTK_EXPANDER_EXPANDED :
|
||||||
GTK_EXPANDER_COLLAPSED;
|
GTK_EXPANDER_COLLAPSED;
|
||||||
|
|
||||||
|
if (GTK_BIN (expander)->child)
|
||||||
|
{
|
||||||
gtk_widget_set_child_visible (GTK_BIN (expander)->child, priv->expanded);
|
gtk_widget_set_child_visible (GTK_BIN (expander)->child, priv->expanded);
|
||||||
gtk_widget_queue_resize (GTK_WIDGET (expander));
|
gtk_widget_queue_resize (GTK_WIDGET (expander));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (expander), "expanded");
|
g_object_notify (G_OBJECT (expander), "expanded");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user