8 winid_t mainwin = glk_window_open(0, 0, 0, wintype_TextGrid, 0);
12 glk_set_window(mainwin);
13 glk_put_string("Philip en Marijn zijn vet goed.\n");
14 glk_put_string("A veeeeeeeeeeeeeeeeeeeeeeeeeeeery looooooooooooooooooooooooong striiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiing.\n");
17 for(count = 0; count < 30; count++)
18 glk_put_string("I want to write past the end of this text buffer! ");
20 guint32 width, height;
21 glk_window_get_size(mainwin, &width, &height);
22 fprintf(stderr, "\nWidth: %d\nHeight: %d\nPress a key in the window, not in the terminal.\n", width, height);
23 glk_request_char_event(mainwin);
26 if(ev.type == evtype_CharInput)
30 glk_window_move_cursor(mainwin, 15, 15);
31 glk_put_string(". . ");
32 glk_window_move_cursor(mainwin, 15, 16);
33 glk_put_string(" . .");
34 glk_window_move_cursor(mainwin, 15, 17);
35 glk_put_string(". . ");
36 glk_window_move_cursor(mainwin, 15, 18);
37 glk_put_string(" . .");
38 fprintf(stderr, "Cursor location test.\nPress another key.\n");
39 glk_request_char_event(mainwin);
42 if(ev.type == evtype_CharInput)
46 gchar *buffer = g_malloc0(256);
48 fprintf(stderr, "Line input field until end of line\n");
49 glk_window_move_cursor(mainwin, 10, 20);
50 glk_request_line_event(mainwin, buffer, 256, 0);
53 if(ev.type == evtype_LineInput)
57 fprintf(stderr, "Now edit your previous line input\n");
58 glk_window_move_cursor(mainwin, 10, 22);
59 glk_request_line_event(mainwin, buffer, 256, strlen(buffer));
62 if(ev.type == evtype_LineInput)
66 gchar *text = g_strndup(buffer, ev.val1);
67 fprintf(stderr, "Your string was: '%s'.\nPress another key to clear the window and exit.\n", text);
69 glk_request_char_event(mainwin);
72 if(ev.type == evtype_CharInput)
76 glk_window_clear(mainwin);