summaryrefslogtreecommitdiff
path: root/examples/tablet.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/tablet.c')
-rw-r--r--examples/tablet.c8
1 files changed, 5 insertions, 3 deletions
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"