From c059e3aa7f93da470f052a5cd8ee0d8dc969e679 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 13:44:13 +0300 Subject: rename and simplification --- examples/simple_window.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'examples/simple_window.c') diff --git a/examples/simple_window.c b/examples/simple_window.c index 85db04a..797de3b 100644 --- a/examples/simple_window.c +++ b/examples/simple_window.c @@ -120,23 +120,23 @@ int main(void) return 1; } - struct yasl_surface_spec surf_spec = { + struct yasl_window_cbs window_cbs = { + .draw = on_draw, + .configure = on_configure, + .close = on_close, + }; + struct yasl_window_spec window_spec = { .title = "YASL Interactive Window (Pen & Touch Enabled)", .size = { .x = 640, .y = 480 }, + .cbs = &window_cbs, }; - struct yasl_surface *s = yasl_surface_create_toplevel(d, &surf_spec); + struct yasl_surface *s = yasl_surface_create_toplevel(d, &window_spec); if (!s) { fprintf(stderr, "Failed to create surface\n"); yasl_display_close(d); return 1; } - struct yasl_surface_cbs surf_cbs = { - .draw = on_draw, - .configure = on_configure, - .close = on_close, - }; - yasl_surface_set_callbacks(s, &surf_cbs, NULL); yasl_surface_schedule_redraw(s); printf("=== YASL Demo Running ===\n"); -- cgit v1.2.3