[comp.windows.x] border pixel

joe@AI.MIT.EDU (Joe Heel) (11/29/89)

I'm running X11 R3 and awm. I can't seem to figure out
how to set the border color of a window I create. 
Here's some of what I tried to get a black border color (on
a bw machine).

  attr.border_pixel = XBlackPixel(dpy, 0);
  attr.event_mask = ButtonPressMask | ExposureMask;
  attr.background_pixel = WhitePixelOfScreen(scr);  
  
  win = XCreateWindow(dpy, RootWindowOfScreen(scr),
		      winx, winy, winw, winh, 0, 
		      DefaultDepthOfScreen(scr), InputOutput,
		      DefaultVisualOfScreen(scr),
		      CWBackPixel | CWBorderPixel | CWEventMask, &attr);
  
  gc = XCreateGC(dpy, win, 0, NULL);

Other alternatives I tried instead of the first line above were

  attr.border_pixel = XBlackPixel(dpy, 0);
  attr.border_pixel = BlackPixel(dpy, scr);
  attr.border_pixel = BlackPixelOfScreen(scr);

Nothing works. What's wrong? Thanks for the help.


	-- Joe


  

klee@chico.pa.dec.com (Ken Lee) (11/30/89)

In article <8911282344.AA01428@special-k>, joe@AI.MIT.EDU (Joe Heel) writes:
> I'm running X11 R3 and awm. I can't seem to figure out
> how to set the border color of a window I create. 
> Here's some of what I tried to get a black border color (on
> a bw machine).

Your code looks fine.  Try running your program without your window
manager.  Many window managers override your border colors and use
their own.  In that case you'll have to configure your window manager
to use your colors.

Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@decwrl.dec.com
uucp: uunet!decwrl!klee