gtktexthandle: Set parent through API call

The GtkWidget::parent property went readonly, use the API call
to ensure the text handle has a parent set.
This commit is contained in:
Carlos Garnacho 2020-04-25 00:09:41 +02:00
parent 9ed579505d
commit 2c23546ba9

View File

@ -459,10 +459,14 @@ gtk_text_handle_init (GtkTextHandle *widget)
GtkTextHandle *
gtk_text_handle_new (GtkWidget *parent)
{
return g_object_new (GTK_TYPE_TEXT_HANDLE,
"parent", parent,
"css-name", I_("cursor-handle"),
NULL);
GtkTextHandle *handle;
handle = g_object_new (GTK_TYPE_TEXT_HANDLE,
"css-name", I_("cursor-handle"),
NULL);
gtk_widget_set_parent (GTK_WIDGET (handle), parent);
return handle;
}
void