From 1891e18f3c837ef511ee012605f1c2f37ab6294a Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Tue, 30 May 2023 00:38:23 +0200 Subject: Add draw function in CherryWindow --- src/window.c | 3 ++- src/window.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/window.c b/src/window.c index 729008b..52cd923 100644 --- a/src/window.c +++ b/src/window.c @@ -78,7 +78,7 @@ cherry_window_new(void) window->base = cherry_widget_new(); window->title = NULL; window->listener = NULL; - window->base->draw = cherry_window_draw; + window->draw = cherry_window_draw; int offset = 10; int x, y, width, height; @@ -168,6 +168,7 @@ cherry_window_set_visible(CherryWindow *w, int visible) { CherryApplication *app = cherry_application_get_running_app(); + w->draw((CherryWidget *) w ); if (visible) { XMapRaised(app->display, w->window_handler); } diff --git a/src/window.h b/src/window.h index a24b237..b7a3081 100644 --- a/src/window.h +++ b/src/window.h @@ -15,6 +15,7 @@ typedef struct CherryWindow { GC gc; int (*listener)(struct CherryWindow *, CherryEvent); + void (*draw)(struct CherryWidget *); } CherryWindow; CherryWindow *cherry_window_new(void); -- cgit v1.2.3