map window points

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@58 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-09-29 05:58:28 +00:00
parent e7582cd646
commit 29b344f831
6 changed files with 61 additions and 10 deletions

View File

@@ -20,6 +20,12 @@ static void lldownhandler(MwLL handle) {
h->pressed = 1;
}
static void llresizehandler(MwLL handle) {
MwWidget h = (MwWidget)handle->user;
MwDispatchUserHandler(h, MwNresizeHandler, NULL);
}
MwWidget MwCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height) {
MwWidget h = malloc(sizeof(*h));
@@ -32,10 +38,11 @@ MwWidget MwCreateWidget(MwClass widget_class, const char* name, MwWidget parent,
h->widget_class = widget_class;
h->pressed = 0;
h->lowlevel->user = h;
h->lowlevel->handler->draw = lldrawhandler;
h->lowlevel->handler->up = lluphandler;
h->lowlevel->handler->down = lldownhandler;
h->lowlevel->user = h;
h->lowlevel->handler->draw = lldrawhandler;
h->lowlevel->handler->up = lluphandler;
h->lowlevel->handler->down = lldownhandler;
h->lowlevel->handler->resize = llresizehandler;
if(parent != NULL) arrput(parent->children, h);