]> saetta.ns0.it Git - zakform/libzakform/commitdiff
Added function ZakForm::remove_element (refs #1104).
authorAndrea Zagli <azagli@libero.it>
Wed, 9 Aug 2017 13:42:37 +0000 (15:42 +0200)
committerAndrea Zagli <azagli@libero.it>
Wed, 9 Aug 2017 13:42:37 +0000 (15:42 +0200)
src/form.c
src/form.h

index a4135fefcab17485ba35c4d6317132a3298ca6cd..bc3000b0cc6cf7b4f489499466788d81bf1cd1e0 100644 (file)
@@ -305,6 +305,23 @@ zak_form_form_add_element (ZakFormForm *zakform, ZakFormElement *element)
        return ret;
 }
 
+/**
+ * zak_form_form_remove_element:
+ * @zakform:
+ * @element:
+ *
+ * Returns: #TRUE if @element is added; FALSE otherwise.
+ */
+gboolean
+zak_form_form_remove_element (ZakFormForm *zakform, ZakFormElement *element)
+{
+       ZakFormFormPrivate *priv;
+
+       priv = zak_form_form_get_instance_private (zakform);
+
+       return g_ptr_array_remove (priv->ar_elements, (gpointer)element);
+}
+
 /**
  * zak_form_form_remove_element_by_id:
  * @zakform:
index 2ccc2ca16444c073e716c4678e57f77af4c2ce6a..f860fa7b5437ccb5c3a674bc88db2d6f0561e575 100644 (file)
@@ -49,6 +49,7 @@ gboolean zak_form_form_load_from_xml (ZakFormForm *zakform, xmlDoc *xmldoc);
 gboolean zak_form_form_load_from_file (ZakFormForm *zakform, const gchar *filename);
 
 gboolean zak_form_form_add_element (ZakFormForm *zakform, ZakFormElement *element);
+gboolean zak_form_form_remove_element (ZakFormForm *zakform, ZakFormElement *element);
 gboolean zak_form_form_remove_element_by_id (ZakFormForm *zakform, const gchar *id);
 ZakFormElement *zak_form_form_get_element_by_id (ZakFormForm *zakform, const gchar *id);
 GPtrArray *zak_form_form_get_elements (ZakFormForm *zakform);