Path: utzoo!attcan!uunet!husc6!bloom-beacon!WHEATIES.AI.MIT.EDU!sundar
From: sundar@WHEATIES.AI.MIT.EDU (Sundar Narasimhan)
Newsgroups: comp.windows.x
Subject: question about X11 server implementation on the suns
Message-ID: <8807052348.AA01827@special-k.ai.mit.edu>
Date: 5 Jul 88 23:48:24 GMT
Sender: daemon@bloom-beacon.MIT.EDU
Organization: The Internet
Lines: 78


Hi:
Does anyone know if the gc's modified by the XSetDashes() function
works to produce dashed lines correctly on the Suns? (I am using X11 on
a 3/60 monochrome running 3.4 SunOS)

(I ask this because I've tried using this function with the following
patterns as shown below always with the same result... i.e.all the
different gc's lines look like the same dotdash pattern (or maybe the
following way to use this function the wrong thing to do?))

Thanks,
-Sundar

static char dotted [] = { 8, 2 };
static char dotdash [] = { 8, 8, 8, 2};
static char dashed [] =  { 8, 8};
static char dotdotdash[] = {8, 8, 8, 2, 4, 2};
static char dash3dot[] = {8, 2, 8, 2, 8, 2, 8, 8};

set_dashes_in_gc(dpy, gc, pat)
Display *dpy;
GC gc;
int pat;
{
    switch(pat) {
      case 0:
	return;
      case 1:
	XSetDashes(dpy, gc, 0, dotted, 2);
	break;
      case 2:
	XSetDashes(dpy, gc, 0, dotdash, 4);
	break;
      case 3:
	XSetDashes(dpy, gc, 0, dashed, 2);
	break;
      case 4:
	XSetDashes(dpy, gc, 0, dotdotdash, 6);
	break;
      case 5:
	XSetDashes(dpy, gc, 0, dash3dot, 8);
	break;
      default:
	break;
    }
}

create_gcs()
{
    XGCValues values;
    Display *dpy = XtDisplay(top);
    Screen *s = XtScreen(top);
    register int i;

    values.line_width = 1;
    values.foreground = BlackPixelOfScreen(s);

    for(i=0;i