implement stuff on gdi backend

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@264 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-11 10:49:14 +00:00
parent 86d630c9c9
commit b8eabc6864
14 changed files with 131 additions and 23 deletions

View File

@@ -6,15 +6,22 @@ void ok(MwWidget handle, void* user, void* call) {
}
void spawn(MwWidget handle, void* user, void* call) {
MwWidget mb = MwMessageBox(user, "new news arrived!", "title", MwMB_ICONNEWS | MwMB_BUTTONOK);
MwWidget mb = MwMessageBox(user, "news has arrived!", "title", MwMB_ICONNEWS | MwMB_BUTTONOK);
MwAddUserHandler(MwMessageBoxGetChild(mb, MwMB_BUTTONOK), MwNactivateHandler, ok, mb);
}
void spawn2(MwWidget handle, void* user, void* call) {
MwWidget mb = MwMessageBox(user, "something went wrong!", "title", MwMB_ICONERROR | MwMB_BUTTONOK);
MwAddUserHandler(MwMessageBoxGetChild(mb, MwMB_BUTTONOK), MwNactivateHandler, ok, mb);
}
int main() {
MwWidget msg = MwVaCreateWidget(MwWindowClass, "test", NULL, MwDEFAULT, MwDEFAULT, 300, 100, MwNtitle, "test", NULL);
MwWidget btn = MwVaCreateWidget(MwButtonClass, "button", msg, 8, 8, 300 - 16, 100 - 16, MwNtext, "press me!", NULL);
MwWidget msg = MwVaCreateWidget(MwWindowClass, "test", NULL, MwDEFAULT, MwDEFAULT, 300, 100, MwNtitle, "test", NULL);
MwWidget btn = MwVaCreateWidget(MwButtonClass, "button", msg, 8, 8, 300 - 16, (100 - 16) / 2, MwNtext, "press me!", NULL);
MwWidget btn2 = MwVaCreateWidget(MwButtonClass, "button", msg, 8, 8 + (100 - 16) / 2, 300 - 16, (100 - 16) / 2, MwNtext, "press me!", NULL);
MwAddUserHandler(btn, MwNactivateHandler, spawn, msg);
MwAddUserHandler(btn2, MwNactivateHandler, spawn2, msg);
MwLoop(msg);
}