<property name="position">0</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton" id="button5">
+ <property name="label" translatable="yes">Is changed?</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
void
is_valid_clicked (GtkButton *button,
- gpointer user_data)
+ gpointer user_data)
{
zak_form_gtk_form_is_valid (form, w);
}
+void
+is_changed_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ if (zak_form_form_is_changed (ZAK_FORM_FORM (form)))
+ {
+ GtkWidget *dialog;
+
+ dialog = gtk_message_dialog_new (GTK_WINDOW (w),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Form is changed.");
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ }
+}
+
int
main (int argc, char *argv[])
{
G_CALLBACK (update_clicked), NULL);
g_signal_connect (gtk_builder_get_object (builder, "button4"), "clicked",
G_CALLBACK (is_valid_clicked), NULL);
+ g_signal_connect (gtk_builder_get_object (builder, "button5"), "clicked",
+ G_CALLBACK (is_changed_clicked), NULL);
form = zak_form_gtk_form_new ();
zak_form_gtk_form_set_gtkbuilder (form, builder);
zak_form_form_load_from_file (ZAK_FORM_FORM (form), XMLDIR "/main.xml");
zak_form_form_clear (ZAK_FORM_FORM (form));
+ zak_form_form_set_as_original (ZAK_FORM_FORM (form));
gdaex = gdaex_new_from_string ("SQLite://DB_DIR=" DBDIR ";DB_NAME=main.db;");
provider = zak_form_gdaex_provider_new (gdaex, "clients");