remove MwMessageBoxDestroy, introduce destroy_inject
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
20d1a455e7
commit
a59154d5f1
9 changed files with 22 additions and 22 deletions
|
|
@ -78,7 +78,7 @@ static void msgbox_okay(MwWidget handle, void* user, void* call) {
|
|||
(void)user;
|
||||
(void)call;
|
||||
|
||||
MwMessageBoxDestroy(handle->parent);
|
||||
MwDestroyWidget(handle->parent);
|
||||
}
|
||||
|
||||
static void files_activate(MwWidget handle, void* user, void* call) {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,18 @@ static void spawn_button(MwWidget handle, int x, int y, int id, const char* text
|
|||
handle->opaque = mb;
|
||||
}
|
||||
|
||||
static void messagebox_destroy_inject(MwWidget handle) {
|
||||
void* px;
|
||||
|
||||
if((px = MwGetVoid(handle, MwNpixmap)) != NULL) MwLLDestroyPixmap(px);
|
||||
}
|
||||
|
||||
static void messagebox_close(MwWidget handle, void* user, void* call) {
|
||||
(void)user;
|
||||
(void)call;
|
||||
MwDestroyWidget(handle);
|
||||
}
|
||||
|
||||
MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsigned int flag) {
|
||||
MwWidget window;
|
||||
int w, h;
|
||||
|
|
@ -106,6 +118,9 @@ MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsi
|
|||
MwLLMakePopup(window->lowlevel, handle == NULL ? NULL : handle->lowlevel);
|
||||
MwLLEndStateChange(window->lowlevel);
|
||||
|
||||
MwAddUserHandler(window, MwNcloseHandler, messagebox_close, NULL);
|
||||
window->destroy_inject = messagebox_destroy_inject;
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
|
|
@ -114,10 +129,3 @@ MwWidget MwMessageBoxGetChild(MwWidget handle, int child) {
|
|||
|
||||
return hmget(mb, child);
|
||||
}
|
||||
|
||||
void MwMessageBoxDestroy(MwWidget handle) {
|
||||
void* px;
|
||||
|
||||
if((px = MwGetVoid(handle, MwNpixmap)) != NULL) MwLLDestroyPixmap(px);
|
||||
MwDestroyWidget(handle);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue