Commit d1d235ad authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Make the reference to the mnemonic widget weak. (#93334, Murray Cumming)

Mon Sep 30 15:45:49 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtklabel.c (gtk_label_set_mnemonic_widget):
        Make the reference to the mnemonic widget weak.
        (#93334, Murray Cumming)
parent ee6acce7
Mon Sep 30 15:45:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.c (gtk_label_set_mnemonic_widget):
Make the reference to the mnemonic widget weak.
(#93334, Murray Cumming)
Mon Sep 30 15:38:53 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h: Remove a duplicate definition
......
Mon Sep 30 15:45:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.c (gtk_label_set_mnemonic_widget):
Make the reference to the mnemonic widget weak.
(#93334, Murray Cumming)
Mon Sep 30 15:38:53 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h: Remove a duplicate definition
......
Mon Sep 30 15:45:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.c (gtk_label_set_mnemonic_widget):
Make the reference to the mnemonic widget weak.
(#93334, Murray Cumming)
Mon Sep 30 15:38:53 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h: Remove a duplicate definition
......
Mon Sep 30 15:45:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.c (gtk_label_set_mnemonic_widget):
Make the reference to the mnemonic widget weak.
(#93334, Murray Cumming)
Mon Sep 30 15:38:53 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h: Remove a duplicate definition
......
Mon Sep 30 15:45:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.c (gtk_label_set_mnemonic_widget):
Make the reference to the mnemonic widget weak.
(#93334, Murray Cumming)
Mon Sep 30 15:38:53 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h: Remove a duplicate definition
......
Mon Sep 30 15:45:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.c (gtk_label_set_mnemonic_widget):
Make the reference to the mnemonic widget weak.
(#93334, Murray Cumming)
Mon Sep 30 15:38:53 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h: Remove a duplicate definition
......
......@@ -718,6 +718,15 @@ gtk_label_hierarchy_changed (GtkWidget *widget,
gtk_label_setup_mnemonic (label, label->mnemonic_keyval);
}
static void
label_mnemonic_widget_weak_notify (gpointer data,
GObject *where_the_object_was)
{
GtkLabel *label = data;
label->mnemonic_widget = NULL;
g_object_notify (G_OBJECT (label), "mnemonic_widget");
}
/**
* gtk_label_set_mnemonic_widget:
......@@ -747,10 +756,14 @@ gtk_label_set_mnemonic_widget (GtkLabel *label,
g_return_if_fail (GTK_IS_WIDGET (widget));
if (label->mnemonic_widget)
gtk_widget_unref (label->mnemonic_widget);
g_object_weak_unref (label->mnemonic_widget,
label_mnemonic_widget_weak_notify,
label);
label->mnemonic_widget = widget;
if (label->mnemonic_widget)
gtk_widget_ref (label->mnemonic_widget);
g_object_weak_ref (label->mnemonic_widget,
label_mnemonic_widget_weak_notify,
label);
g_object_notify (G_OBJECT (label), "mnemonic_widget");
}
......
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