mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-03 16:10:50 +00:00
messagebox can be closed now
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@362 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
MwWidget wmain;
|
||||
|
||||
void destroy(MwWidget handle, void* user, void* call) {
|
||||
(void)handle;
|
||||
(void)call;
|
||||
MwMessageBoxDestroy(user);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include <Mw/Milsko.h>
|
||||
|
||||
void ok(MwWidget handle, void* user, void* call) {
|
||||
(void)handle;
|
||||
(void)call;
|
||||
MwMessageBoxDestroy(user);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ static void llclosehandler(MwLL handle, void* data) {
|
||||
}
|
||||
} else {
|
||||
h->close = 1;
|
||||
MwDispatchUserHandler(h, MwNcloseHandler, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,12 @@ static void spawn_button(MwWidget handle, int x, int y, int id, const char* text
|
||||
handle->opaque = mb;
|
||||
}
|
||||
|
||||
static void messagebox_close(MwWidget handle, void* user, void* call) {
|
||||
(void)user;
|
||||
(void)call;
|
||||
MwMessageBoxDestroy(handle);
|
||||
}
|
||||
|
||||
MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsigned int flag) {
|
||||
MwWidget window;
|
||||
MwPoint p;
|
||||
@@ -95,6 +101,8 @@ MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsi
|
||||
MwLLSetSizeHints(window->lowlevel, w, h, w, h);
|
||||
MwLLMakePopup(window->lowlevel, handle->lowlevel);
|
||||
|
||||
MwAddUserHandler(window, MwNcloseHandler, messagebox_close, NULL);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user