[comp.windows.x] Need help with Xw versus Xaw problem

gram@uctcs.uucp (Graham Wheeler) (01/25/91)

I have struggled all morning trying to get a simple program to draw a grid
working using Xaw's viewport widget. After trying everything I could think
of, I gave up, and thought I would see what happened if I used the HP
widgets WorkSpace widget instead. Well, I should have done it earlier - the
program worked immediately.

It is a very simple program - it creates a viewport/workspace widget, sets
a graphics context, then does a few calls to XDrawLine. Can anyone give me
an explanation why I get no lines with the viewport widget? Is this widget
unsuitable for graphics, and if so, what Xaw widget should I be using? I can
mail the program (with ifdef's for HP) if this will help.

Thanks in advance.
Graham Wheeler		      |	"Don't bother me, I'm reading a `Crisis'!"
Data Network Architectures Lab| Internet: <gram@uctcs.uct.ac.za>
Dept. of Computer Science     | Fidonet: <gram.uctcs@f4.n494.z5.fidonet.org>
University of Cape Town       |     BANG: <...uunet!ddsw1!olsa99!uctcs!gram>

pete@iris49.UUCP (Pete Ware) (02/05/91)

I imagine the problem is the viewport widget creates a "clipping"
window to keep the child of the viewport widget constrained to between
the scrollbars.  In other words, the viewport's window (where you are
drawing your lines) is hidden behind a second window -- the clipping
window.

Suggestions:
1. Try writing your own widget to do your graphics, it really isn't
that hard!

2. Keep using the HP WorkSpace widget

3. Try creating another widget, such as Label, as a child of the
Viewport and do your drawing into that widget.

--pete
Pete Ware / Biosym / San Diego CA / (619) 546-5532
uucp:	  scripps.edu!bioc1!pete
Internet: bioc1!pete@scripps.edu