# # Illustrates primarily the XChangeGC function. # Additionally, illustrates the drawing of lines and text and the use # of Fonts. # # See Also ./lines.s # (function() { load("Motif") X = XApplication("none") draw = Widget("draw","XmDrawingArea", X@widget,realize=T) XRealize(X) backingStore(draw,"Always") gc = XGC(X@widget, LineWidth=2, LineStyle="OnOffDash",Function="copy") #gc=XGC(X@widget) x = c(20,100,100) y = c(20,100,150) XLines(x,y,draw,gc = gc) ## ChangeGC(gc,LineWidth=1,LineStyle="LineSolid", CapStyle="CapRound") ChangeGC(gc,LineWidth=3,LineStyle="Solid",DashOffset=3) XLines(x+25,y, draw, gc = gc) XText("Width=2 Style=OnOffDash", 60,175,draw,gc=gc) # fid = XLoadFonts(X,"-adobe-times-bold-i-normal--18-180-75-75-p-98-iso8859-1")[[1]] # ChangeGC(gc,Font = fid) # works XText("Width=1 Style=Solid", 85,190, draw, gc=gc) invisible(return(X)) })()