]> saetta.ns0.it Git - libgtkform/commitdiff
Some bugfixes and adjustments.
authorAndrea Zagli <azagli@libero.it>
Sat, 29 Aug 2009 16:31:03 +0000 (18:31 +0200)
committerAndrea Zagli <azagli@libero.it>
Sat, 29 Aug 2009 16:31:03 +0000 (18:31 +0200)
21 files changed:
data/gtkform.dtd
docs/reference/libgtkform-decl-list.txt
docs/reference/libgtkform-decl.txt
docs/reference/libgtkform-undeclared.txt
docs/reference/libgtkform-undocumented.txt
docs/reference/libgtkform-unused.txt
docs/reference/tmpl/form.sgml
docs/reference/tmpl/libgtkform-unused.sgml
src/field.c
src/field.h
src/fieldboolean.c
src/fielddatetime.c
src/fieldfloat.c
src/fieldinteger.c
src/fieldtext.c
src/form.c
src/form.h
src/widget.c
src/widget.h
test/from_xml.c
test/main.c

index daff5933fd0e29c7070b1d00995b028a7ad90845..202f7c168d28ac953dbe5df44e0313b2744b77ab 100644 (file)
@@ -9,6 +9,7 @@
 <!ATTLIST widget
        type  (checkbox | combobox | entry | label | spin | textview)  #REQUIRED
        name  CDATA  #REQUIRED
+       label  CDATA  #IMPLIED
 >
 
 <!ELEMENT column-field (#PCDATA)>
index 25538b6c67d005eaef19be6eac2f001b7dd6532d..7be037d87f80a340f59c3b5565ebd89a6ac78f36 100644 (file)
@@ -237,8 +237,10 @@ gtk_form_set_key
 gtk_form_add_field
 gtk_form_remove_field
 gtk_form_add_fields
-gtk_form_get_field_from_name
-gtk_form_get_widget_from_name
+gtk_form_get_form_field_from_name
+gtk_form_get_form_widget_from_name
+gtk_form_get_widgets
+gtk_form_get_objects_by_name
 gtk_form_clear
 gtk_form_check
 gtk_form_is_changed
index 5714eac279b25f43ebcd3ef10e0ca20a0ab02f9d..49ca0854bbfd2cd7a84a12d80055546ca6508ba5 100644 (file)
@@ -1027,16 +1027,26 @@ GtkForm *form, GtkFormField *field
 GtkForm *form, ...
 </FUNCTION>
 <FUNCTION>
-<NAME>gtk_form_get_field_from_name</NAME>
+<NAME>gtk_form_get_form_field_from_name</NAME>
 <RETURNS>GtkFormField *</RETURNS>
 GtkForm *form, const gchar *field_name
 </FUNCTION>
 <FUNCTION>
-<NAME>gtk_form_get_widget_from_name</NAME>
+<NAME>gtk_form_get_form_widget_from_name</NAME>
 <RETURNS>GtkFormWidget *</RETURNS>
 GtkForm *form, const gchar *widget_name
 </FUNCTION>
 <FUNCTION>
+<NAME>gtk_form_get_widgets</NAME>
+<RETURNS>GtkWidget **</RETURNS>
+GtkForm *form
+</FUNCTION>
+<FUNCTION>
+<NAME>gtk_form_get_objects_by_name</NAME>
+<RETURNS>GObject **</RETURNS>
+GtkForm *form, ...
+</FUNCTION>
+<FUNCTION>
 <NAME>gtk_form_clear</NAME>
 <RETURNS>gboolean </RETURNS>
 GtkForm *form
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a47720b2df730b51c67d66284366c101f5b4456e 100644 (file)
@@ -0,0 +1,2 @@
+gtk_form_get_field_from_name
+gtk_form_get_widget_from_name
index cafe887904d72966fcf0d9f9472c29777cc39798..a85e31dda4090cb9232cb42669c78242c13d9485 100644 (file)
@@ -1,7 +1,7 @@
 6% symbol docs coverage.
 17 symbols documented.
 2 symbols incomplete.
-259 not documented.
+261 not documented.
 
 
 GTK_FORM
@@ -175,13 +175,15 @@ gtk_form_field_text_new
 gtk_form_field_text_set_from_datamodel
 gtk_form_filed_boolean_is_changed
 gtk_form_fill_from_datamodel
-gtk_form_get_field_from_name
+gtk_form_get_form_field_from_name
+gtk_form_get_form_widget_from_name
 gtk_form_get_gtkbuilder
 gtk_form_get_key
+gtk_form_get_objects
+gtk_form_get_objects_by_name
 gtk_form_get_sql
 gtk_form_get_table
 gtk_form_get_type
-gtk_form_get_widget_from_name
 gtk_form_is_changed
 gtk_form_key_add_field
 gtk_form_key_add_fields
index 183596d03165381119893fb34b6816d300a6ec49..bac144faf4a497f7f165aab37081274a10a854eb 100644 (file)
@@ -21,9 +21,13 @@ gtk_form_field_integer_is_changed
 gtk_form_field_is_changed
 gtk_form_field_text_is_changed
 gtk_form_filed_boolean_is_changed
+gtk_form_get_form_field_from_name
+gtk_form_get_form_widget_from_name
 gtk_form_get_gtkbuilder
 gtk_form_get_key
+gtk_form_get_objects_by_name
 gtk_form_get_table
+gtk_form_get_widgets
 gtk_form_is_changed
 gtk_form_new_from_file
 gtk_form_new_from_xml
index 0a5b80e0b61f8977f4f3a9944381078509a32207..98718124b078376499a1f164890dc83b6ab534a1 100644 (file)
@@ -126,26 +126,6 @@ Form
 @Returns: 
 
 
-<!-- ##### FUNCTION gtk_form_get_field_from_name ##### -->
-<para>
-
-</para>
-
-@form: 
-@field_name: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gtk_form_get_widget_from_name ##### -->
-<para>
-
-</para>
-
-@form: 
-@widget_name: 
-@Returns: 
-
-
 <!-- ##### FUNCTION gtk_form_clear ##### -->
 <para>
 
index 2923d25e0c76c2bef9934e0a513b430cfaec538e..6d3df2761c3f425bd6c3aaf0f58a7c9856a4b8bc 100644 (file)
 @value: 
 @Returns: 
 
+<!-- ##### FUNCTION gtk_form_get_field_from_name ##### -->
+<para>
+
+</para>
+
+@form: 
+@field_name: 
+@Returns: 
+
+<!-- ##### FUNCTION gtk_form_get_widget_from_name ##### -->
+<para>
+
+</para>
+
+@form: 
+@widget_name: 
+@Returns: 
+
index 3b4925e0f0436d63851c2efb18d2bcff0ac433fd..4ed31fbd3f0fe410db898bfb887738f24b0a9b7e 100644 (file)
@@ -142,13 +142,13 @@ const gchar
 }
 
 /**
- * gtk_form_field_get_gtk_form_widget:
+ * gtk_form_field_get_form_widget:
  * @field: a #GtkFormField object.
  *
  * Return: the associated #GtkFormWidget.
  */
 GtkFormWidget
-*gtk_form_field_get_gtk_form_widget (GtkFormField *field)
+*gtk_form_field_get_form_widget (GtkFormField *field)
 {
        GtkFormFieldPrivate *priv = GTK_FORM_FIELD_GET_PRIVATE (field);
 
@@ -231,11 +231,12 @@ gtk_form_field_clear (GtkFormField *field)
  * gtk_form_field_is_empty:
  * @field: a #GtkFormField object.
  *
+ * Returns: TRUE if the field is empty.
  */
 gboolean
 gtk_form_field_is_empty (GtkFormField *field)
 {
-       gboolean ret = FALSE;
+       gboolean ret = TRUE;
 
        if (IS_GTK_FORM_FIELD (field) && GTK_FORM_FIELD_GET_CLASS (field)->is_empty != NULL)
                {
index ece738c996b3dc789ac303593b34dd889c941ddd..370a882a2fde17bdbf073fbdfcc8131ce3cc344e 100644 (file)
@@ -65,7 +65,7 @@ GtkFormField *gtk_form_field_new (void);
 GtkFormField *gtk_form_field_new_from_gtk_form_widget (GtkFormWidget *fwidget);
 
 const gchar *gtk_form_field_get_field_name (GtkFormField *field);
-GtkFormWidget *gtk_form_field_get_gtk_form_widget (GtkFormField *field);
+GtkFormWidget *gtk_form_field_get_form_widget (GtkFormField *field);
 
 const gchar *gtk_form_field_get_value_stringify (GtkFormField *field);
 const GValue *gtk_form_field_get_value (GtkFormField *field);
index d93cf800a515394211e37354f2bc8b6c3b112902..47777fb9fb6e23cec4b408e3fc61f7a1592b8368 100644 (file)
@@ -202,7 +202,11 @@ gtk_form_field_boolean_clear (GtkFormField *field)
 gboolean
 gtk_form_field_boolean_is_empty (GtkFormField *field)
 {
-       gboolean ret = TRUE;
+       gboolean ret;
+
+       g_return_val_if_fail (IS_GTK_FORM_FIELD_BOOLEAN (field), TRUE);
+
+       ret = FALSE;
 
        return ret;
 }
index 0be7c6544bb4512550e9d1e20c7a91668b57d77e..993b4767fd8b961b743af157f9d638efe191d4ff 100644 (file)
@@ -250,7 +250,11 @@ gtk_form_field_datetime_clear (GtkFormField *field)
 gboolean
 gtk_form_field_datetime_is_empty (GtkFormField *field)
 {
-       gboolean ret = TRUE;
+       gboolean ret;
+
+       g_return_val_if_fail (IS_GTK_FORM_FIELD_DATETIME (field), TRUE);
+
+       ret = FALSE;
 
        return ret;
 }
@@ -273,12 +277,15 @@ gtk_form_field_datetime_is_changed (GtkFormField *field)
 
        value = gtk_form_field_datetime_get_tm_from_str (gtk_form_field_datetime_get_value_stringify (field));
 
-       ret = (value->tm_year != priv->original_value->tm_year
-              || value->tm_mon != priv->original_value->tm_mon
-              || value->tm_mday != priv->original_value->tm_mday
-              || value->tm_hour != priv->original_value->tm_hour
-              || value->tm_min != priv->original_value->tm_min
-              || value->tm_sec != priv->original_value->tm_sec);
+       if (value != NULL)
+               {
+                       ret = (value->tm_year != priv->original_value->tm_year
+                                  || value->tm_mon != priv->original_value->tm_mon
+                                  || value->tm_mday != priv->original_value->tm_mday
+                                  || value->tm_hour != priv->original_value->tm_hour
+                                  || value->tm_min != priv->original_value->tm_min
+                                  || value->tm_sec != priv->original_value->tm_sec);
+               }
 
        return ret;
 }
index 36e4a43a8637c02d99a0f8591d52e408696a9e8a..654d6e0e0492015bfe3c7c6242a7827b446f1be2 100644 (file)
@@ -195,12 +195,18 @@ gtk_form_field_float_clear (GtkFormField *field)
 gboolean
 gtk_form_field_float_is_empty (GtkFormField *field)
 {
-       gboolean ret = TRUE;
+       gboolean ret;
        const gchar *value;
 
+       g_return_val_if_fail (IS_GTK_FORM_FIELD_FLOAT (field), TRUE);
+
        value = gtk_form_field_float_get_value_stringify (field);
 
-       if (strtod (value, NULL) == 0.0f)
+       if (g_strtod (value, NULL) == 0.0f)
+               {
+                       ret = TRUE;
+               }
+       else
                {
                        ret = FALSE;
                }
index 3e896c22cf3587b494a44b48f8a6616b18cafe90..a68e8be366becae19d908249c38468bd85c4cb39 100644 (file)
@@ -186,12 +186,18 @@ gtk_form_field_integer_clear (GtkFormField *field)
 gboolean
 gtk_form_field_integer_is_empty (GtkFormField *field)
 {
-       gboolean ret = TRUE;
+       gboolean ret;
        const gchar *value;
 
+       g_return_val_if_fail (IS_GTK_FORM_FIELD_INTEGER (field), TRUE);
+
        value = gtk_form_field_integer_get_value_stringify (field);
 
        if (strtol (value, NULL, 10) == 0)
+               {
+                       ret = TRUE;
+               }
+       else
                {
                        ret = FALSE;
                }
index 23d467e4b580ebf7deaf4bea5b695ba4b144bebb..b765f641005f03ac576448dca6d7f30218cacf5a 100644 (file)
@@ -186,12 +186,18 @@ gtk_form_field_text_clear (GtkFormField *field)
 gboolean
 gtk_form_field_text_is_empty (GtkFormField *field)
 {
-       gboolean ret = TRUE;
+       gboolean ret;
        const gchar *value;
 
+       g_return_val_if_fail (IS_GTK_FORM_FIELD_TEXT (field), TRUE);
+
        value = gtk_form_field_text_get_value_stringify (field);
 
-       if (strcmp (value, "") == 0)
+       if (g_strcmp0 (value, "") == 0)
+               {
+                       ret = TRUE;
+               }
+       else
                {
                        ret = FALSE;
                }
index a865d744b8bea9736a6e0c5d10682618812c5c59..f2d2310d6b4dece299d32f7cdc47559023f6ae37 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <libxml/xpath.h>
 
+#include <gtk/gtk.h>
+
 #include "form.h"
 
 #include "fieldboolean.h"
@@ -144,6 +146,7 @@ GtkForm
                                {
                                        gchar *type;
                                        gchar *name;
+                                       gchar *label;
 
                                        GtkFormWidget *widget;
                                        xmlNode *node_widget;
@@ -240,6 +243,14 @@ GtkForm
                                                                                        if (GTK_IS_BUILDER (priv->gtkbuilder))
                                                                                                {
                                                                                                        gtk_form_widget_set_from_gtkbuilder (widget, priv->gtkbuilder, name);
+
+                                                                                                       label = xmlGetProp (cur, (const xmlChar *)"label");
+                                                                                                       if (label != NULL && g_strcmp0 (g_strstrip (label), "") != 0)
+                                                                                                               {
+                                                                                                                       GtkLabel *wlabel;
+                                                                                                                       wlabel = GTK_LABEL (gtk_builder_get_object (priv->gtkbuilder, label));
+                                                                                                                       gtk_form_widget_set_label (widget, wlabel);
+                                                                                                               }
                                                                                                }
 
                                                                                        node_widget = cur->children;
@@ -625,7 +636,7 @@ GtkFormWidget
        GSList *fields = priv->fields;
        while (fields != NULL)
                {
-                       widget = gtk_form_field_get_gtk_form_widget ((GtkFormField *)fields->data);
+                       widget = gtk_form_field_get_form_widget ((GtkFormField *)fields->data);
 
                        if (strcmp (gtk_form_widget_get_widget_name (widget), widget_name) == 0)
                                {
@@ -671,7 +682,7 @@ GtkWidget
                        l++;
                        ret = g_realloc (ret, l * sizeof (GtkWidget *));
 
-                       form_widget = gtk_form_field_get_gtk_form_widget ((GtkFormField *)fields->data);
+                       form_widget = gtk_form_field_get_form_widget ((GtkFormField *)fields->data);
                        widget = gtk_form_widget_get_widget (form_widget);
                        ret[l] = widget;
 
@@ -706,7 +717,7 @@ GObject
 
        priv = GTK_FORM_GET_PRIVATE (form);
 
-       if (priv->gtkbuilder == NULL) return NULL;
+       g_return_val_if_fail (GTK_IS_BUILDER (priv->gtkbuilder), NULL);
 
        ret = NULL;
        l = 0;
@@ -716,11 +727,22 @@ GObject
        while ((object_name = va_arg (vargs, gchar *)) != NULL)
                {
                        object = gtk_builder_get_object (priv->gtkbuilder, object_name);
-                       if (object != NULL)
+                       if (G_IS_OBJECT (object))
                                {
                                        l++;
-                                       ret = g_realloc (ret, l * sizeof (GObject *));
-                                       ret[l] = object;
+                                       if (l == 1)
+                                               {
+                                                       ret = g_malloc (sizeof (GObject *));
+                                               }
+                                       else
+                                               {
+                                                       ret = g_realloc (ret, l * sizeof (GObject *));
+                                               }
+                                       ret[l - 1] = object;
+                               }
+                       else
+                               {
+                                       g_warning ("Object «%s» not found.", object_name);
                                }
                }
 
@@ -764,20 +786,34 @@ gtk_form_clear (GtkForm *form)
 /**
  * gtk_form_check:
  * @form: a #GtkForm object.
+ * @form_widget: a #GtkFormWidget.
+ * @show_error_dialog:
+ * @set_focus:
  *
- * Returns: TRUE if all obligatory fields are full.
+ * Returns: TRUE if all obligatory fields are full and @widget is NULL. Otherwise
+ * if @widget isn't NULL, it is the first #GtkFormWidget empty.
  */
 gboolean
-gtk_form_check (GtkForm *form)
+gtk_form_check (GtkForm *form, GtkFormWidget **form_widget,
+                gboolean show_error_dialog, GtkWidget *parent_window,
+                gboolean set_focus)
 {
        GtkFormPrivate *priv;
        GSList *fields;
        GtkFormField *field;
+       GtkFormWidget *fwidget;
+       GtkWidget *widget;
 
        gboolean ret = TRUE;
        gboolean obl = FALSE;
 
        g_return_val_if_fail (IS_GTK_FORM (form), FALSE);
+       g_return_val_if_fail (form_widget == NULL || *form_widget == NULL, FALSE);
+
+       if (show_error_dialog)
+               {
+                       g_return_val_if_fail (GTK_IS_WINDOW (parent_window), FALSE);
+               }
 
        priv = GTK_FORM_GET_PRIVATE (form);
 
@@ -791,9 +827,47 @@ gtk_form_check (GtkForm *form)
                                      "obligatory", &obl,
                                      NULL);
 
-                       if (obl && !gtk_form_field_is_empty (field))
+                       if (obl && gtk_form_field_is_empty (field))
                                {
                                        ret = FALSE;
+
+                                       fwidget = gtk_form_field_get_form_widget (field);
+                                       widget = gtk_form_widget_get_widget (fwidget);
+
+                                       if (form_widget != NULL)
+                                               {
+                                                       *form_widget = fwidget;
+                                               }
+
+                                       if (show_error_dialog)
+                                               {
+                                                       GtkWidget *dialog;
+                                                       GtkWidget *label;
+                                                       const gchar *label_text;
+
+                                                       label = gtk_form_widget_get_label (fwidget);
+                                                       if (GTK_IS_LABEL (label))
+                                                               {
+                                                                       label_text = gtk_label_get_text (GTK_LABEL (label));
+                                                               }
+                                                       else
+                                                               {
+                                                                       label_text = gtk_form_widget_get_widget_name (fwidget);
+                                                               }
+
+                                                       dialog = gtk_message_dialog_new (GTK_WINDOW (parent_window),
+                                                                                        GTK_DIALOG_DESTROY_WITH_PARENT,
+                                                                                        GTK_MESSAGE_WARNING,
+                                                                                        GTK_BUTTONS_OK,
+                                                                                        "The field «%s» is obligatory.", label_text);
+                                                       gtk_dialog_run (GTK_DIALOG (dialog));
+                                                       gtk_widget_destroy (dialog);
+                                               }
+
+                                       if (set_focus)
+                                               {
+                                                       gtk_widget_grab_focus (widget);
+                                               }
                                        break;
                                }
 
@@ -863,7 +937,7 @@ gtk_form_set_sensitive (GtkForm *form, gboolean sensitive)
        GSList *fields = priv->fields;
        while (fields != NULL)
                {
-                       fwidget = gtk_form_field_get_gtk_form_widget ((GtkFormField *)fields->data);
+                       fwidget = gtk_form_field_get_form_widget ((GtkFormField *)fields->data);
 
                        widget = gtk_form_widget_get_widget (fwidget);
                        gtk_widget_set_sensitive (widget, sensitive);
@@ -889,7 +963,7 @@ gtk_form_set_editable (GtkForm *form, gboolean editable)
        GSList *fields = priv->fields;
        while (fields != NULL)
                {
-                       fwidget = gtk_form_field_get_gtk_form_widget ((GtkFormField *)fields->data);
+                       fwidget = gtk_form_field_get_form_widget ((GtkFormField *)fields->data);
 
                        gtk_form_widget_set_editable (fwidget, editable);
 
index 8fb0367b8255696897e41d3f7413d8d1ca28574b..672225f13ced0be5057307763573d20bd09ff197 100644 (file)
@@ -79,7 +79,9 @@ GObject **gtk_form_get_objects_by_name (GtkForm *form, ...);
 
 gboolean gtk_form_clear (GtkForm *form);
 
-gboolean gtk_form_check (GtkForm *form);
+gboolean gtk_form_check (GtkForm *form, GtkFormWidget **form_widget,
+                         gboolean show_error_dialog, GtkWidget *parent_window,
+                         gboolean set_focus);
 
 gboolean gtk_form_is_changed (GtkForm *form);
 
index 908c866b38a87d94cdfe9e1b2da6c383c7056e77..9522816ceae81ced999041fe34396f87c795791e 100644 (file)
@@ -46,6 +46,8 @@ struct _GtkFormWidgetPrivate
        {
                GtkWidget *widget;
                gchar *widget_name;
+
+               GtkWidget *label;
        };
 
 
@@ -98,7 +100,7 @@ GtkFormWidget
 
 /**
  * gtk_form_widget_set_from_gtkbuilder:
- * @fwidget:
+ * @fwidget: a #GtkFormWidget object.
  * @gtkbuilder:
  * @widget_name:
  *
@@ -108,9 +110,16 @@ gtk_form_widget_set_from_gtkbuilder (GtkFormWidget *fwidget,
                                      GtkBuilder *gtkbuilder,
                                      const gchar *widget_name)
 {
-       gboolean ret = FALSE;
+       gboolean ret;
+
+       GtkWidget *w;
+
+       g_return_val_if_fail (IS_GTK_FORM_WIDGET (fwidget), FALSE);
+       g_return_val_if_fail (GTK_IS_BUILDER (gtkbuilder), FALSE);
+
+       ret = FALSE;
 
-       GtkWidget *w = GTK_WIDGET (gtk_builder_get_object (gtkbuilder, widget_name));
+       w = GTK_WIDGET (gtk_builder_get_object (gtkbuilder, widget_name));
        if (w != NULL)
                {
                        g_object_set (fwidget,
@@ -120,40 +129,88 @@ gtk_form_widget_set_from_gtkbuilder (GtkFormWidget *fwidget,
 
                        ret = TRUE;
                }
+       else
+               {
+                       g_warning ("Widget «%s» not found.", widget_name);
+               }
 
        return ret;
 }
 
 /**
  * gtk_form_widget_get_widget:
- * @fwidget:
+ * @fwidget: a #GtkFormWidget object.
  *
  */
 GtkWidget
 *gtk_form_widget_get_widget (GtkFormWidget *fwidget)
 {
-       GtkFormWidgetPrivate *priv = GTK_FORM_WIDGET_GET_PRIVATE (fwidget);
+       GtkFormWidgetPrivate *priv;
+
+       g_return_val_if_fail (IS_GTK_FORM_WIDGET (fwidget), NULL);
+
+       priv = GTK_FORM_WIDGET_GET_PRIVATE (fwidget);
 
        return priv->widget;
 }
 
 /**
  * gtk_form_widget_get_widget_name:
- * @fwidget:
+ * @fwidget: a #GtkFormWidget object.
  *
  * Returns: the #GtkFormWidget's name.
  */
 const gchar
 *gtk_form_widget_get_widget_name (GtkFormWidget *fwidget)
 {
-       GtkFormWidgetPrivate *priv = GTK_FORM_WIDGET_GET_PRIVATE (fwidget);
+       GtkFormWidgetPrivate *priv;
+
+       g_return_val_if_fail (IS_GTK_FORM_WIDGET (fwidget), NULL);
+
+       priv = GTK_FORM_WIDGET_GET_PRIVATE (fwidget);
 
        return (const gchar *)g_strdup (priv->widget_name);
 }
 
+/**
+ * gtk_form_widget_get_label:
+ * @fwidget: a #GtkFormWidget object.
+ *
+ */
+GtkWidget
+*gtk_form_widget_get_label (GtkFormWidget *fwidget)
+{
+       GtkFormWidgetPrivate *priv;
+
+       g_return_val_if_fail (IS_GTK_FORM_WIDGET (fwidget), NULL);
+
+       priv = GTK_FORM_WIDGET_GET_PRIVATE (fwidget);
+
+       return priv->label;
+}
+
+/**
+ * gtk_form_widget_set_label:
+ * @fwidget: a #GtkFormWidget object.
+ * @label: a @GtkLabel object.
+ *
+ */
+void
+gtk_form_widget_set_label (GtkFormWidget *fwidget, GtkLabel *label)
+{
+       GtkFormWidgetPrivate *priv;
+
+       g_return_if_fail (IS_GTK_FORM_WIDGET (fwidget));
+       g_return_if_fail (GTK_IS_LABEL (label));
+
+       priv = GTK_FORM_WIDGET_GET_PRIVATE (fwidget);
+
+       priv->label = GTK_WIDGET (label);
+}
+
 /**
  * gtk_form_widget_get_value_stringify:
- * @fwidget:
+ * @fwidget: a #GtkFormWidget object.
  *
  */
 const gchar
@@ -167,7 +224,7 @@ const gchar
 
 /**
  * gtk_form_widget_set_value_stringify:
- * @fwidget:
+ * @fwidget: a #GtkFormWidget object.
  * @value:
  *
  */
@@ -182,7 +239,7 @@ gtk_form_widget_set_value_stringify (GtkFormWidget *fwidget, const gchar *value)
 
 /**
  * gtk_form_widget_set_editable:
- * @fwidget:
+ * @fwidget: a #GtkFormWidget object.
  * @editable:
  *
  */
index 98f0eaa077c10729ab36ae1efa86be1dbe4a1392..29e07022c58eed96830366ef52fb942857b42dfe 100644 (file)
@@ -65,6 +65,9 @@ GtkWidget *gtk_form_widget_get_widget (GtkFormWidget *fwidget);
 
 const gchar *gtk_form_widget_get_widget_name (GtkFormWidget *fwidget);
 
+GtkWidget *gtk_form_widget_get_label (GtkFormWidget *fwidget);
+void gtk_form_widget_set_label (GtkFormWidget *fwidget, GtkLabel *label);
+
 const gchar *gtk_form_widget_get_value_stringify (GtkFormWidget *fwidget);
 
 gboolean gtk_form_widget_set_value_stringify (GtkFormWidget *fwidget, const gchar *value);
index 2a1ab1f1d2d42a846a869b2cfb2e26c3b0dbffae..f2e36382ec7a5bd18475a425fd58ca13898ce991 100644 (file)
@@ -53,7 +53,7 @@ void
 on_btnCheck_clicked (GtkButton *button,
                      gpointer user_data)
 {
-       if (!gtk_form_check (form))
+       if (!gtk_form_check (form, NULL, FALSE, NULL, FALSE))
                {
                        GtkWidget *diag = gtk_message_dialog_new (GTK_WINDOW (w),
                                                                  GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
index 09488f485ffa3725d4708a1bf38beac2ab71570e..9c572aa972294fd5006a3cae9b6e02b638caedff 100644 (file)
@@ -67,7 +67,7 @@ void
 on_btnCheck_clicked (GtkButton *button,
                      gpointer user_data)
 {
-       if (!gtk_form_check (form))
+       if (!gtk_form_check (form, NULL, FALSE, NULL, FALSE))
                {
                        GtkWidget *diag = gtk_message_dialog_new (GTK_WINDOW (w),
                                                                  GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,