#include <gtk/gtk.h>

static void
notify_handler(GtkEntry* entry, GParamSpec* pspec) {
	static int i = 0;
	g_message("notify:  %d: »%s«", ++i, gtk_entry_get_text(entry));
}

static void
changed_handler(GtkEntry* entry) {
	static int i = 0;
	g_message("changed: %d: »%s«", ++i, gtk_entry_get_text(entry));
}

int
main(int argc, char** argv) {
	GtkWidget* entry = NULL;
	gtk_init(&argc, &argv);
	entry = gtk_entry_new();
	gtk_entry_set_text(GTK_ENTRY(entry), "text");
	g_signal_connect(entry, "notify::text",
			 G_CALLBACK(notify_handler), NULL);
	g_signal_connect(entry, "changed",
			 G_CALLBACK(changed_handler), NULL);
	gtk_entry_set_text(GTK_ENTRY(entry), "example");
	return 0;
}
