[comp.windows.x] Using Xlib calls in Xaw viewport

rmartin@remus.rutgers.edu (Richard Martin) (07/30/90)

How can I get the window ID of the child window in a viewport widget?
I tried to use XtGetValues and XtWindow on the children resource
without success.  I am trying to use Xlib calls,( XDrawLines,
XCopyArea, etc) inside the viewport to take advantage of the automatic
scrolling. Is it possible to use the viewport widget in this way?
Thanks in advance-
						-Rich
						 rmartin@remus.rutgers.edu

rlh2@ukc.ac.uk (Richard Hesketh) (07/30/90)

In article <Jul.29.16.32.02.1990.29653@remus.rutgers.edu> rmartin@remus.rutgers.edu (Richard Martin) writes:
>
>How can I get the window ID of the child window in a viewport widget?

The viewport requires you to add a child to do any scrolling.  Therefore
you ought to know the widget id. of this child (?).

>I tried to use XtGetValues and XtWindow on the children resource
>without success.

Hmm, the viewport can have up to 4 managed children, the scrollable
child, the "clip" window, "horizontal" and "vertical" scrollbars.
You should be able to retrieve the scrollable child by looking for a widget that
isn't named "clip", "horizontal" or "vertical" in the XtNchildren resource.
If you want any of the other children you can use
XtNameToWidget(viewport, "clip") etc.

>                 I am trying to use Xlib calls,( XDrawLines,
>XCopyArea, etc) inside the viewport to take advantage of the automatic
>scrolling. Is it possible to use the viewport widget in this way?

Yes (if I understand you rightly).  Of course you must have an exposure
routine to redraw the parts of the child that have been newly exposed.
The easiest way to do this is to add expose and resize event handlers
to a core class widget.  Make this core widget the a child of the viewport.