From be4f110bf96c9c3cecad41f2b90bab827ca94770 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sat, 5 Dec 2015 11:39:51 +0100 Subject: [PATCH] Tested filter and validator. --- data/zakformtests/gui/main.ui | 28 +++++++++++++++++++++++++++- data/zakformtests/xml/main.xml | 2 ++ src/main.c | 12 +++++++++++- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/data/zakformtests/gui/main.ui b/data/zakformtests/gui/main.ui index d1a6092..b682c31 100644 --- a/data/zakformtests/gui/main.ui +++ b/data/zakformtests/gui/main.ui @@ -361,6 +361,32 @@ 1 + + + True + False + 5 + center + + + Is valid? + True + True + True + + + True + True + 0 + + + + + False + True + 2 + + True @@ -376,7 +402,7 @@ True True - 2 + 3 diff --git a/data/zakformtests/xml/main.xml b/data/zakformtests/xml/main.xml index 336425f..32de09e 100644 --- a/data/zakformtests/xml/main.xml +++ b/data/zakformtests/xml/main.xml @@ -25,6 +25,8 @@ John Doe txt_name + + diff --git a/src/main.c b/src/main.c index 7d1aaf0..6ee8149 100644 --- a/src/main.c +++ b/src/main.c @@ -24,6 +24,8 @@ #include #include +GtkWidget *w; + ZakFormGtkForm *form; ZakFormGdaexProvider *provider; @@ -48,11 +50,17 @@ update_clicked (GtkButton *button, zak_form_form_update (ZAK_FORM_FORM (form), ZAK_FORM_IPROVIDER (provider)); } +void +is_valid_clicked (GtkButton *button, + gpointer user_data) +{ + zak_form_gtk_form_is_valid (form, w); +} + int main (int argc, char *argv[]) { GtkBuilder *builder; - GtkWidget *w; GdaEx *gdaex; @@ -74,6 +82,8 @@ main (int argc, char *argv[]) G_CALLBACK (insert_clicked), NULL); g_signal_connect (gtk_builder_get_object (builder, "button3"), "clicked", G_CALLBACK (update_clicked), NULL); + g_signal_connect (gtk_builder_get_object (builder, "button4"), "clicked", + G_CALLBACK (is_valid_clicked), NULL); form = zak_form_gtk_form_new (); zak_form_gtk_form_set_gtkbuilder (form, builder); -- 2.49.0