diff options
Diffstat (limited to 'src/comet.c')
| -rw-r--r-- | src/comet.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/comet.c b/src/comet.c index 21bad7a..2b0cf40 100644 --- a/src/comet.c +++ b/src/comet.c @@ -39,6 +39,11 @@ static void log_handler(const char *log_domain, g_print("%s\n", message); } +static void action(Button *btn) +{ + log_info("Called action: %s", btn->text); +} + int main(int argc, char **argv) { g_log_set_default_handler(log_handler, (gpointer)G_LOG_LEVEL_DEBUG); @@ -65,10 +70,12 @@ int main(int argc, char **argv) for (int i = 0; i < 9; ++i) { char text[] = { '1' + i, '\0' }; Button *btn = button_create(text, true); + button_set_action(btn, action); state_add_button(state, btn); } Button *btn = button_create("long button", false); + button_set_action(btn, action); state_add_button(state, btn); draw_compute_layout(draw, state->btns, window_get_context(win)); |
