fix
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@719 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
parent
4fe99a5601
commit
2737f0fcf9
6 changed files with 17 additions and 7 deletions
|
|
@ -8,7 +8,7 @@ void ok(MwWidget handle, void* user, void* call) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void spawn(MwWidget handle, void* user, void* call) {
|
void spawn(MwWidget handle, void* user, void* call) {
|
||||||
MwWidget mb = MwMessageBox(user, "news has arrived!", "title", MwMB_ICONNEWS | MwMB_BUTTONOK);
|
MwWidget mb = MwMessageBox(handle, "news has arrived!", "title", MwMB_ICONNEWS | MwMB_BUTTONOK);
|
||||||
|
|
||||||
(void)handle;
|
(void)handle;
|
||||||
(void)call;
|
(void)call;
|
||||||
|
|
|
||||||
|
|
@ -869,7 +869,7 @@ static void MwLLMakePopupImpl(MwLL handle, MwLL parent) {
|
||||||
Atom wndstate = XInternAtom(handle->x11.display, "_NET_WM_STATE", False);
|
Atom wndstate = XInternAtom(handle->x11.display, "_NET_WM_STATE", False);
|
||||||
Atom wndmodal = XInternAtom(handle->x11.display, "_NET_WM_STATE_MODAL", False);
|
Atom wndmodal = XInternAtom(handle->x11.display, "_NET_WM_STATE_MODAL", False);
|
||||||
|
|
||||||
XSetTransientForHint(handle->x11.display, handle->x11.window, parent->x11.window);
|
if(parent != NULL) XSetTransientForHint(handle->x11.display, handle->x11.window, parent->x11.window);
|
||||||
XChangeProperty(handle->x11.display, handle->x11.window, wndtype, XA_ATOM, 32, PropModeReplace, (unsigned char*)&wnddlg, 1);
|
XChangeProperty(handle->x11.display, handle->x11.window, wndtype, XA_ATOM, 32, PropModeReplace, (unsigned char*)&wnddlg, 1);
|
||||||
XChangeProperty(handle->x11.display, handle->x11.window, wndstate, XA_ATOM, 32, PropModeReplace, (unsigned char*)&wndmodal, 1);
|
XChangeProperty(handle->x11.display, handle->x11.window, wndstate, XA_ATOM, 32, PropModeReplace, (unsigned char*)&wndmodal, 1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -280,7 +280,10 @@ int MwStep(MwWidget handle) {
|
||||||
handle->prop_event = 1;
|
handle->prop_event = 1;
|
||||||
|
|
||||||
clean_destroy_queue(handle);
|
clean_destroy_queue(handle);
|
||||||
if(handle->parent == NULL && handle->destroyed) return 1;
|
if(handle->parent == NULL && handle->destroyed){
|
||||||
|
MwFreeWidget(handle);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -371,7 +374,10 @@ void MwSetVoid(MwWidget handle, const char* key, void* value) {
|
||||||
MwLLSetIcon(handle->lowlevel, value);
|
MwLLSetIcon(handle->lowlevel, value);
|
||||||
} else if(strcmp(key, MwNsizeHints) == 0) {
|
} else if(strcmp(key, MwNsizeHints) == 0) {
|
||||||
MwSizeHints* sz = value;
|
MwSizeHints* sz = value;
|
||||||
|
|
||||||
|
MwLLBeginStateChange(handle->lowlevel);
|
||||||
MwLLSetSizeHints(handle->lowlevel, sz->min_width, sz->min_height, sz->max_width, sz->max_height);
|
MwLLSetSizeHints(handle->lowlevel, sz->min_width, sz->min_height, sz->max_width, sz->max_height);
|
||||||
|
MwLLEndStateChange(handle->lowlevel);
|
||||||
} else {
|
} else {
|
||||||
shput(handle->data, key, value);
|
shput(handle->data, key, value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -371,7 +371,7 @@ MwWidget MwColorPicker(MwWidget handle, const char* title) {
|
||||||
|
|
||||||
MwLLBeginStateChange(window->lowlevel);
|
MwLLBeginStateChange(window->lowlevel);
|
||||||
if(handle != NULL) MwLLDetach(window->lowlevel, &p);
|
if(handle != NULL) MwLLDetach(window->lowlevel, &p);
|
||||||
MwLLMakePopup(window->lowlevel, handle->lowlevel);
|
MwLLMakePopup(window->lowlevel, handle == NULL ? NULL : handle->lowlevel);
|
||||||
MwLLEndStateChange(window->lowlevel);
|
MwLLEndStateChange(window->lowlevel);
|
||||||
|
|
||||||
return window;
|
return window;
|
||||||
|
|
|
||||||
|
|
@ -509,7 +509,7 @@ MwWidget MwFileChooser(MwWidget handle, const char* title) {
|
||||||
|
|
||||||
MwLLBeginStateChange(window->lowlevel);
|
MwLLBeginStateChange(window->lowlevel);
|
||||||
if(handle != NULL) MwLLDetach(window->lowlevel, &p);
|
if(handle != NULL) MwLLDetach(window->lowlevel, &p);
|
||||||
MwLLMakePopup(window->lowlevel, handle->lowlevel);
|
MwLLMakePopup(window->lowlevel, handle == NULL ? NULL : handle->lowlevel);
|
||||||
MwLLEndStateChange(window->lowlevel);
|
MwLLEndStateChange(window->lowlevel);
|
||||||
|
|
||||||
return window;
|
return window;
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsi
|
||||||
int wy;
|
int wy;
|
||||||
int ww = handle == NULL ? 0 : MwGetInteger(handle, MwNwidth);
|
int ww = handle == NULL ? 0 : MwGetInteger(handle, MwNwidth);
|
||||||
int wh = handle == NULL ? 0 : MwGetInteger(handle, MwNheight);
|
int wh = handle == NULL ? 0 : MwGetInteger(handle, MwNheight);
|
||||||
|
MwSizeHints sh;
|
||||||
|
|
||||||
w = 512;
|
w = 512;
|
||||||
h = 32 * 4;
|
h = 32 * 4;
|
||||||
|
|
@ -43,10 +44,14 @@ MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsi
|
||||||
wx = wy = 0;
|
wx = wy = 0;
|
||||||
if(handle == NULL) wx = wy = MwDEFAULT;
|
if(handle == NULL) wx = wy = MwDEFAULT;
|
||||||
|
|
||||||
|
sh.min_width = sh.max_width = w;
|
||||||
|
sh.min_height = sh.max_height = h;
|
||||||
|
|
||||||
p.x = (ww - w) / 2;
|
p.x = (ww - w) / 2;
|
||||||
p.y = (wh - h) / 2;
|
p.y = (wh - h) / 2;
|
||||||
window = MwVaCreateWidget(MwWindowClass, "messagebox", handle, wx, wy, w, h,
|
window = MwVaCreateWidget(MwWindowClass, "messagebox", handle, wx, wy, w, h,
|
||||||
MwNtitle, title,
|
MwNtitle, title,
|
||||||
|
MwNsizeHints, &sh,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
window->opaque = NULL;
|
window->opaque = NULL;
|
||||||
|
|
@ -106,8 +111,7 @@ MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsi
|
||||||
|
|
||||||
MwLLBeginStateChange(window->lowlevel);
|
MwLLBeginStateChange(window->lowlevel);
|
||||||
if(handle != NULL) MwLLDetach(window->lowlevel, &p);
|
if(handle != NULL) MwLLDetach(window->lowlevel, &p);
|
||||||
MwLLSetSizeHints(window->lowlevel, w, h, w, h);
|
MwLLMakePopup(window->lowlevel, handle == NULL ? NULL : handle->lowlevel);
|
||||||
MwLLMakePopup(window->lowlevel, handle->lowlevel);
|
|
||||||
MwLLEndStateChange(window->lowlevel);
|
MwLLEndStateChange(window->lowlevel);
|
||||||
|
|
||||||
MwAddUserHandler(window, MwNcloseHandler, messagebox_close, NULL);
|
MwAddUserHandler(window, MwNcloseHandler, messagebox_close, NULL);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue