mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-19 23:54:12 +00:00
messagebox
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@257 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -406,3 +406,12 @@ void MwLLShow(MwLL handle, int show) {
|
||||
ShowWindow(handle->hWnd, show ? SW_NORMAL : SW_HIDE);
|
||||
if(show) SetFocus(handle->hWnd);
|
||||
}
|
||||
|
||||
void MwLLMakePopup(MwLL handle, MwLL parent) {
|
||||
(void)handle;
|
||||
(void)parent;
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
void MwLLSetSizeHints(MwLL handle, int minx, int miny, int maxx, int maxy) {
|
||||
}
|
||||
|
||||
@@ -452,3 +452,25 @@ void MwLLShow(MwLL handle, int show) {
|
||||
XUnmapWindow(handle->display, handle->window);
|
||||
}
|
||||
}
|
||||
|
||||
void MwLLMakePopup(MwLL handle, MwLL parent) {
|
||||
Atom wndtype = XInternAtom(handle->display, "_NET_WM_WINDOW_TYPE", False);
|
||||
Atom wnddlg = XInternAtom(handle->display, "_NET_WM_WINDOW_TYPE_DIALOG", False);
|
||||
Atom wndstate = XInternAtom(handle->display, "_NET_WM_STATE", False);
|
||||
Atom wndmodal = XInternAtom(handle->display, "_NET_WM_STATE_MODAL", False);
|
||||
|
||||
XSetTransientForHint(handle->display, handle->window, parent->window);
|
||||
XChangeProperty(handle->display, handle->window, wndtype, XA_ATOM, 32, PropModeReplace, (unsigned char*)&wnddlg, 1);
|
||||
XChangeProperty(handle->display, handle->window, wndstate, XA_ATOM, 32, PropModeReplace, (unsigned char*)&wndmodal, 1);
|
||||
}
|
||||
|
||||
void MwLLSetSizeHints(MwLL handle, int minx, int miny, int maxx, int maxy) {
|
||||
XSizeHints* hints = XAllocSizeHints();
|
||||
hints->flags = PMinSize | PMaxSize;
|
||||
hints->min_width = minx;
|
||||
hints->min_height = miny;
|
||||
hints->max_width = maxx;
|
||||
hints->max_height = maxy;
|
||||
XSetWMSizeHints(handle->display, handle->window, hints, XA_WM_NORMAL_HINTS);
|
||||
XFree(hints);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xcursor/Xcursor.h>
|
||||
#include <X11/extensions/XShm.h>
|
||||
#include <X11/extensions/Xrender.h>
|
||||
|
||||
Reference in New Issue
Block a user