mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
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)
This commit is contained in:
parent
ee6acce769
commit
d1d235adcb
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
@ -1,3 +1,9 @@
|
||||
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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user