From: Andrea Zagli Date: Wed, 28 Jul 2010 07:24:28 +0000 (+0200) Subject: Added function GtkForm::get_widget_from_form_field_name. X-Git-Tag: 0.1.4~4 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=ee8f9122d0d067d9a38893bc83dd883663bc2e76;p=libgtkform Added function GtkForm::get_widget_from_form_field_name. --- diff --git a/docs/reference/libgtkform-decl-list.txt b/docs/reference/libgtkform-decl-list.txt index 8f94da5..c70119d 100644 --- a/docs/reference/libgtkform-decl-list.txt +++ b/docs/reference/libgtkform-decl-list.txt @@ -296,6 +296,7 @@ gtk_form_remove_field gtk_form_add_fields gtk_form_get_form_field_from_name gtk_form_get_form_widget_from_name +gtk_form_get_widget_from_form_field_name gtk_form_get_widget_from_form_widget_name gtk_form_get_form_field_from_widget gtk_form_get_form_widget_from_widget diff --git a/docs/reference/libgtkform-decl.txt b/docs/reference/libgtkform-decl.txt index 91ca611..772b30c 100644 --- a/docs/reference/libgtkform-decl.txt +++ b/docs/reference/libgtkform-decl.txt @@ -1249,6 +1249,11 @@ GtkForm *form, const gchar *field_name GtkForm *form, const gchar *widget_name +gtk_form_get_widget_from_form_field_name +GtkWidget * +GtkForm *form, const gchar *field_name + + gtk_form_get_widget_from_form_widget_name GtkWidget * GtkForm *form, const gchar *widget_name diff --git a/docs/reference/libgtkform-undocumented.txt b/docs/reference/libgtkform-undocumented.txt index f3d9712..a57870d 100644 --- a/docs/reference/libgtkform-undocumented.txt +++ b/docs/reference/libgtkform-undocumented.txt @@ -1,7 +1,7 @@ 8% symbol docs coverage. 28 symbols documented. 2 symbols incomplete. -314 not documented. +315 not documented. GTK_FORM @@ -210,6 +210,7 @@ gtk_form_get_sql gtk_form_get_table gtk_form_get_type gtk_form_get_values_as_hashtable +gtk_form_get_widget_from_form_field_name gtk_form_get_widget_from_form_widget_name gtk_form_get_widget_from_name gtk_form_group_add_field diff --git a/docs/reference/libgtkform-unused.txt b/docs/reference/libgtkform-unused.txt index 54d74f8..0497419 100644 --- a/docs/reference/libgtkform-unused.txt +++ b/docs/reference/libgtkform-unused.txt @@ -56,6 +56,7 @@ gtk_form_get_key gtk_form_get_objects_by_name gtk_form_get_table gtk_form_get_values_as_hashtable +gtk_form_get_widget_from_form_field_name gtk_form_get_widget_from_form_widget_name gtk_form_get_widgets gtk_form_group_add_field diff --git a/src/form.c b/src/form.c index d3541ce..4672e3f 100644 --- a/src/form.c +++ b/src/form.c @@ -954,6 +954,36 @@ GtkFormWidget return widget_ret; } +/** + * gtk_form_get_widget_from_form_field_name: + * @form: a #GtkForm object. + * @field_name: the #GtkFormField's name to return. + * + * Returns: a #GtkWidget. + */ +GtkWidget +*gtk_form_get_widget_from_form_field_name (GtkForm *form, const gchar *field_name) +{ + GtkFormField *field = NULL; + GtkFormWidget *widget = NULL; + GtkWidget *widget_ret = NULL; + + g_return_val_if_fail (IS_GTK_FORM (form), NULL); + g_return_val_if_fail (field_name != NULL, NULL); + + field = gtk_form_get_form_field_from_name (form, field_name); + if (field != NULL) + { + widget = gtk_form_field_get_form_widget (field); + if (widget != NULL) + { + widget_ret = gtk_form_widget_get_widget (widget); + } + } + + return widget_ret; +} + /** * gtk_form_get_widget_from_form_widget_name: * @form: a #GtkForm object. diff --git a/src/form.h b/src/form.h index eedfe48..5c33ade 100644 --- a/src/form.h +++ b/src/form.h @@ -77,6 +77,7 @@ gboolean gtk_form_add_fields (GtkForm *form, ...); GtkFormField *gtk_form_get_form_field_from_name (GtkForm *form, const gchar *field_name); GtkFormWidget *gtk_form_get_form_widget_from_name (GtkForm *form, const gchar *widget_name); +GtkWidget *gtk_form_get_widget_from_form_field_name (GtkForm *form, const gchar *field_name); GtkWidget *gtk_form_get_widget_from_form_widget_name (GtkForm *form, const gchar *widget_name); GtkFormField *gtk_form_get_form_field_from_widget (GtkForm *form, GtkWidget *widget);