Example #1
0
 void drawBand(int x, int y, int width, int height) {
   if ((style & SWT.SMOOTH) != 0) return;
   int display = OS.XtDisplay(parent.handle);
   if (display == 0) return;
   int window = OS.XtWindow(parent.handle);
   if (window == 0) return;
   int foreground = parent.getForegroundPixel();
   Control control = parent.findBackgroundControl();
   if (control == null) control = parent;
   int background = control.getBackgroundPixel();
   int color = foreground ^ background;
   byte[] bits = {-86, 85, -86, 85, -86, 85, -86, 85};
   int stipplePixmap = OS.XCreateBitmapFromData(display, window, bits, 8, 8);
   int gc = OS.XCreateGC(display, window, 0, null);
   OS.XSetForeground(display, gc, color);
   OS.XSetStipple(display, gc, stipplePixmap);
   OS.XSetSubwindowMode(display, gc, OS.IncludeInferiors);
   OS.XSetFillStyle(display, gc, OS.FillStippled);
   OS.XSetFunction(display, gc, OS.GXxor);
   OS.XFillRectangle(display, window, gc, x, y, width, height);
   OS.XFreePixmap(display, stipplePixmap);
   OS.XFreeGC(display, gc);
 }