X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=tests%2Fmain.c;h=491273903864da625eb74cd74f4cbca70abb6561;hb=4a1188d59e0c9958df56cf5fb61d04ee8fb1e37c;hp=60891d3ea273f92feab5cc818167e794f919b1ca;hpb=6702e46cbf0d5980a7386038d019c03fb12d3b52;p=rodin%2Fchimara.git diff --git a/tests/main.c b/tests/main.c index 60891d3..4912739 100644 --- a/tests/main.c +++ b/tests/main.c @@ -40,7 +40,6 @@ #include #include -#include "callbacks.h" #include "error.h" #include #include @@ -66,7 +65,10 @@ on_stopped(ChimaraGlk *glk) static void on_command(ChimaraGlk *glk, gchar *input, gchar *response) { - g_print("Command: %s\nResponse: %s\n", input, response); + gchar *ellipsized = g_strdelimit(g_strndup(response, 20), "\n", ' '); + g_print("%s - %s%s\n", input, ellipsized, + (strlen(ellipsized) < strlen(response))? "..." : ""); + g_free(ellipsized); } static GObject * @@ -102,6 +104,9 @@ create_window(void) "open", "F7", "save", NULL, /* NULL means use stock accelerator */ "quit", NULL, + "hint", "", + "char_input", "", + "char_input2", "", NULL }; const gchar **ptr; @@ -141,7 +146,7 @@ create_window(void) gtk_box_pack_start(vbox, menubar, FALSE, FALSE, 0); gtk_box_pack_start(vbox, toolbar, FALSE, FALSE, 0); - gtk_builder_connect_signals(builder, NULL); + gtk_builder_connect_signals(builder, glk); } int