summaryrefslogtreecommitdiffstats
path: root/src/splash.c
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-08-06 20:04:00 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-08-06 20:11:00 (EDT)
commit6a45a31b8b7e1a88dc5b6354f12ad40ea43e7dd3 (patch)
tree1f61d2c05336e8ef47f9458e786e64b9affa6d6d /src/splash.c
parenta88d71431d4a41a10df3c0a9baa4223688bbc50b (diff)
downloadmazefight-6a45a31b8b7e1a88dc5b6354f12ad40ea43e7dd3.zip
mazefight-6a45a31b8b7e1a88dc5b6354f12ad40ea43e7dd3.tar.gz
mazefight-6a45a31b8b7e1a88dc5b6354f12ad40ea43e7dd3.tar.bz2
tk: Add text widget event callback
Diffstat (limited to 'src/splash.c')
-rw-r--r--src/splash.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/splash.c b/src/splash.c
index 3c743a3..5c9adb7 100644
--- a/src/splash.c
+++ b/src/splash.c
@@ -32,6 +32,14 @@
#include "util.h"
static int
+_mf_splash_seed(void *user_data, const char *seed)
+{
+ SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Seed: %ld", atol(seed));
+
+ return 0;
+}
+
+static int
_mf_splash_size(void *user_data, int state)
{
switch (state) {
@@ -116,7 +124,7 @@ _mf_splash_form(SDL_Renderer *renderer, TTF_Font *text_font,
mftk_label_new(text_font, "Seed", text_color, renderer),
MFTK_GRID_HALIGN_R|MFTK_GRID_VALIGN_T,
mftk_text_new('0', '9', rand_max_len, seed, text_font,
- text_color),
+ text_color, _mf_splash_seed, NULL),
MFTK_GRID_HALIGN_L|MFTK_GRID_VALIGN_T,
mftk_label_new(text_font, "Size", text_color, renderer),
MFTK_GRID_HALIGN_R|MFTK_GRID_VALIGN_T,