widget: Set widget in accessible's constructor

No need to add t manually later.
This commit is contained in:
Benjamin Otte 2011-12-18 20:21:50 +01:00
parent d801b28365
commit 0c1f2f2fc1
2 changed files with 3 additions and 4 deletions

View File

@ -112,13 +112,10 @@ static void
gtk_widget_accessible_initialize (AtkObject *obj,
gpointer data)
{
GtkAccessible *accessible;
GtkWidget *widget;
widget = GTK_WIDGET (data);
accessible = GTK_ACCESSIBLE (obj);
gtk_accessible_set_widget (accessible, widget);
g_signal_connect_after (widget, "focus-in-event", G_CALLBACK (focus_cb), NULL);
g_signal_connect_after (widget, "focus-out-event", G_CALLBACK (focus_cb), NULL);
g_signal_connect (widget, "notify", G_CALLBACK (notify_cb), NULL);

View File

@ -11409,7 +11409,9 @@ gtk_widget_real_get_accessible (GtkWidget *widget)
}
else
{
accessible = g_object_new (priv->accessible_type, NULL);
accessible = g_object_new (priv->accessible_type,
"widget", widget,
NULL);
if (priv->accessible_role != ATK_ROLE_INVALID)
atk_object_set_role (accessible, priv->accessible_role);