Results 1 to 1 of 1
hi,
i'm looking for a way to draw calculation-results from multiple processes into one single window (processes might run on cluster later). i know there is a library called mpe ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-05-2005 #1Just Joined!
- Join Date
- Oct 2005
- Posts
- 1
Xlib: drawing into window of other process
hi,
i'm looking for a way to draw calculation-results from multiple processes into one single window (processes might run on cluster later). i know there is a library called mpe (within mpich) solving this problem. unfortunately this library only provides very poor functionality and as far as i know only works within mpi (also non mpi-version planned).
i tried serveral toolkits (qt, fltk, ...) but couldn't find a solution. now i'm trying to do so using xlib directly (mpe does so) somehow like this:
- create 2 processes via fork()
- in process 1:
-then passing w and gc to process 2 via shared memory (later via mpi?!?)Code:Display *dpy = XOpenDisplay(0); Window w = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, 200, 100, 0, blackColor, blackColor); XSelectInput(dpy, w, StructureNotifyMask); XMapWindow(dpy, w); GC gc = XCreateGC(dpy, w, 0, NIL); XSetForeground(dpy, gc, whiteColor); for(;;) { XEvent e; XNextEvent(dpy, &e); if (e.type == MapNotify) break; } } XDrawLine(dpy, w, gc, 10, 60, 180, 20); // works XFlush(dpy);
-in process 2:
any solutions?Code:Display *dpy = XOpenDisplay(0); XDrawRectangle(dpy, w, gc, 10, 10, 20, 20); // does not take any effect XFlush(dpy);
thx
baldo


Reply With Quote
