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/tablet.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'examples/tablet.c') diff --git a/examples/tablet.c b/examples/tablet.c index 0aae370..256d8f8 100644 --- a/examples/tablet.c +++ b/examples/tablet.c @@ -327,11 +327,13 @@ int main(int argc, char **argv) if (!display) { perror("Cannot open display"); return 1; } app.backend = yasl_display_backend(display); app.tablet_supported = (yasl_display_caps(display) & YASL_CAP_TABLET) != 0; - struct yasl_surface_spec spec = {.title = "YASL Tablet - pressure and tilt", .size = {900, 640}}; + struct yasl_window_cbs callbacks = {.draw = draw, .configure = configure, .close = close_window}; + struct yasl_window_spec spec = { + .title = "YASL Tablet - pressure and tilt", .size = {900, 640}, + .cbs = &callbacks, .ud = &app, + }; struct yasl_surface *surface = yasl_surface_create_toplevel(display, &spec); if (!surface) { perror("Cannot create surface"); yasl_display_close(display); return 1; } - struct yasl_surface_cbs callbacks = {.draw = draw, .configure = configure, .close = close_window}; - yasl_surface_set_callbacks(surface, &callbacks, &app); yasl_surface_set_cursor(surface, YASL_CURSOR_HIDDEN); yasl_surface_schedule_redraw(surface); printf("YASL tablet on %s: pressure changes brush width; eraser removes ink.\n" -- cgit v1.2.3