Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!agate!pasteur!ames!haven!uvaarpa!mcnc!thorin!lhotse!rajgopal
From: rajgopal@lhotse.cs.unc.edu (Suresh Rajgopal)
Newsgroups: comp.windows.x
Subject: Drawing lines with the Xtool kit
Keywords: X-11VR2 Xtoolkit (Xt), Line Drawing (Widgets)
Message-ID: <4361@thorin.cs.unc.edu>
Date: 23 Sep 88 21:56:51 GMT
Sender: news@thorin.cs.unc.edu
Lines: 45


 I am a new entry into 'X world', and this might be a trivial
  question to some people, but  here goes:

  I am running X.11VR2 on a Sun-3/110(monochrome) and I am using the
 Xt tool kit with the X11 library and some of the Athena
 Widgets in Xaw/

  My question:
    Is  there anyway I can use any of the available widgets
 to draw lines/arcs between two points in a parent widget (a Form widget)?

 I have been trying to use the raw X-11 calls, for the same but 
with not much success. Here is a portion of the relevant code:
---------------------------------------------------------------------
  XtRealizeWidget(toplevel); /* Realizing the root widget and its children*/
   w = XtWindow(form);  /* Yields the Window #, of the  Form Widget*/
  gc = XCreateGC(dpy,w,0,NULL);  /* Create Graphics Context */
 XDrawLine(dpy,w,gc,25,110,50,110); /* Draw the line */
  XtMainLoop();
------------------------------------------------------
  'form' is a child of 'toplevel'.
  I would like the line drawn to be as simple as
possible (i.e with all default attributes if possible)
 I am not  interested in a different Line Style,Line Width etc.
 Are there certain GC values which do not take defaults?

Well, the problem with this code is that it
does nothing. I mean the widgets get displayed, but the
line is not drawn. Does some 'expose widget'
procedure have to be invoked to display parts
 of a widget generated via X-11 primitive calls?

 I do not read this newsgroup normally, so I would
 appreciate it if your replies were e-mailed directly
to me
  
Thanks

-Suresh

   Suresh Rajgopal

    rajgopal@dopey.cs.unc.edu
    uunet!mcnc!unc!rajgopal