diff options
author | 2023-05-30 00:38:23 +0200 | |
---|---|---|
committer | 2023-05-30 00:38:23 +0200 | |
commit | 1891e18f3c837ef511ee012605f1c2f37ab6294a (patch) | |
tree | 0106e96cf5d483bb4693ae656cc587005c1f058e /src | |
parent | 5d5e9a1f02eb92ea136088d618fe6bafff36d5bd (diff) | |
download | cherry-1891e18f3c837ef511ee012605f1c2f37ab6294a.tar.gz cherry-1891e18f3c837ef511ee012605f1c2f37ab6294a.zip |
Add draw function in CherryWindow
Diffstat (limited to 'src')
-rw-r--r-- | src/window.c | 3 | ||||
-rw-r--r-- | src/window.h | 1 |
2 files changed, 3 insertions, 1 deletions
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); |