X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;ds=sidebyside;f=tests%2Fmain.c;h=9ed6158f2245e49593f63e87e820ec33a8cf463d;hb=eced3f0b6a56c6f03eae371450e0a3ed1a6dcfe2;hp=62adca94cdecd58e4c24028f2c83c47866a7234a;hpb=feb837c21fc62720d8094d43cc5ebc1ec3943a6d;p=projects%2Fchimara%2Fchimara.git diff --git a/tests/main.c b/tests/main.c index 62adca9..9ed6158 100644 --- a/tests/main.c +++ b/tests/main.c @@ -62,6 +62,24 @@ on_stopped(ChimaraGlk *glk) g_printerr("Stopped!\n"); } +static void +on_char_input(ChimaraGlk *glk, guint32 window_rock, guint keysym) +{ + g_printerr("Character input in window %d: key %d\n", window_rock, keysym); +} + +static void +on_line_input(ChimaraGlk *glk, guint32 window_rock, gchar *text) +{ + g_printerr("Line input in window %d: '%s'\n", window_rock, text); +} + +static void +on_text_buffer_output(ChimaraGlk *glk, guint32 window_rock, gchar *text) +{ + g_printerr("Text buffer output in window %d: '%s'\n", window_rock, text); +} + static GObject * load_object(const gchar *name) { @@ -115,6 +133,9 @@ create_window(void) chimara_glk_set_monospace_font_string(CHIMARA_GLK(glk), "Monospace 12"); g_signal_connect(glk, "started", G_CALLBACK(on_started), NULL); g_signal_connect(glk, "stopped", G_CALLBACK(on_stopped), NULL); + g_signal_connect(glk, "char-input", G_CALLBACK(on_char_input), NULL); + g_signal_connect(glk, "line-input", G_CALLBACK(on_line_input), NULL); + g_signal_connect(glk, "text-buffer-output", G_CALLBACK(on_text_buffer_output), NULL); GtkBox *vbox = GTK_BOX( gtk_builder_get_object(builder, "vbox") ); if(vbox == NULL) @@ -145,10 +166,7 @@ main(int argc, char *argv[]) if( !g_thread_supported() ) g_thread_init(NULL); - gdk_threads_init(); - - gtk_set_locale(); gtk_init(&argc, &argv); create_window();