[comp.windows.x] graphics context questions

bauersfeld.wbst@XEROX.COM (Penny Bauersfeld) (05/05/88)

I have a couple of problems with GC calls, and I'm curious if I'm doing
something wrong, or if other people have these problems as well (and they are
actually bugs).

First, when I use XSetLineAttributes to change the line_style, it doesn't always
work.  If I change something else in the GC along with the line style (such as
the width or dash list), then the call seems to work fine.  But if I set the
line style alone, no changes are evident.  Specifically, I make calls:

	XSetLineAttributes(display, gc, x_width, LineOnOffDash, x_cap_style,
x_join_style);
	XSetDashes(display, gc, 0, new_dash_list, new_num_dash);
	.
	.
and I get the line style I expect.  Then I make the call:

	XSetLineAttributes(display, gc, x_width, LineSolid, x_cap_style, x_join_style);

and the line style is still dashed, with the previously specified
characteristics.  However, if instead the second call to XSetLineAttributes is:

	XSetLineAttributes(display, gc, new_width, LineSolid, x_cap_style,
x_join_style);

then I get the expected solid line, with the new width value.

Second problem - I can't seem to get the join style to be set to JoinRound.  I
make the call:

	XSetLineAttributes(display, gc, width, style, cap_style, JoinRound);
	
and when I draw a rectangle using XDrawRectangle or XFillRectangle, I get
square-cornered rectangles.  I don't know if this problem is related to the
above problem, but no matter what the width or dash style of the line, I seem to
get no reaction to the join style setting.  Is XSetLineAttributes the wrong
function to use?

I'm working with X.V11R2 on a Sun 3/260 running SunOS 3.2.

Any working examples or explanations of what I may be doing wrong would be much
appreciated.  Thanks, 


~ penny
bauersfeld.wbst@xerox.com