Add gtk_constraint_layout_remove_constraint

Otherwise, you can't do many interesting things.
This commit is contained in:
Matthias Clasen 2019-06-26 03:40:03 +00:00 committed by Emmanuele Bassi
parent 64afa765c8
commit 176d9c6baf
2 changed files with 23 additions and 0 deletions

View File

@ -1106,3 +1106,23 @@ gtk_constraint_layout_add_constraint (GtkConstraintLayout *manager,
g_hash_table_add (manager->constraints, constraint);
}
/**
* gtk_constraint_layout_remove_constraint:
* @manager: a #GtkConstraintLayout
* @constraint: a #GtkConstraint
*
* Removes @constraint from the layout manager,
* so that it no longer influences the layout.
*/
void
gtk_constraint_layout_remove_constraint (GtkConstraintLayout *manager,
GtkConstraint *constraint)
{
g_return_if_fail (GTK_IS_CONSTRAINT_LAYOUT (manager));
g_return_if_fail (GTK_IS_CONSTRAINT (constraint));
g_return_if_fail (gtk_constraint_is_attached (constraint));
gtk_constraint_detach (constraint);
g_hash_table_remove (manager->constraints, constraint);
}

View File

@ -41,6 +41,9 @@ GtkLayoutManager * gtk_constraint_layout_new (void);
GDK_AVAILABLE_IN_ALL
void gtk_constraint_layout_add_constraint (GtkConstraintLayout *manager,
GtkConstraint *constraint);
GDK_AVAILABLE_IN_ALL
void gtk_constraint_layout_remove_constraint (GtkConstraintLayout *manager,
GtkConstraint *constraint);
/**
* GtkConstraintLayoutChild: