[comp.windows.x] Determining what area a viewport will be placed over??

markham@rho.cs.unc.edu (Andrew Markham) (04/11/90)

I have a viewport whose child is a form widget and I would like to be
able to tell the viewport where to position itself.

For example, our form widget contains a list of times of the day along
the left edge (from 12:00 AM - 11:30 PM).  Whenever I draw the screen,
the viewport is positioned at the top of the timelisting (i.e. 12:00),
so I have to scroll down to 9:00.  I would prefer the viewport to start
out positioned at 9:00, instead of 12:00.


In other words, I would like to change the default area to be clipped by
the viewform.


Current area shown upon startup:

	 _______________________
>	| 1 |                   |
>	|___|                   |
>	| 2 |			|
>	|___|                   |
>	| 3 |			|
>	|___|			|
>	| 4 |                   |
>	|___|                   |
	| 5 |                   |
	|___|                   |
	| 6 |                   |
	|___|                   |
	| 7 |                   |
	|___|                   |
	| 8 |                   |
	|___|___________________|

Area we want to show upon startup:

         _______________________
	| 1 |                   |
        |___|                   |
        | 2 |                   |
        |___|                   |
>       | 3 |                   |
>       |___|                   |
>       | 4 |                   |
>       |___|                   |
>       | 5 |                   |
>       |___|                   |
>       | 6 |                   |
>       |___|                   |
        | 7 |                   |
        |___|                   |
        | 8 |                   |
        |___|___________________|


If you have any questions, ask away.  I need help!!!

_|_o		Andrew W. Markham	<markham@wsmail.cs.unc.edu>
| V \O		Computer Science Department	UNC-CH
|    |\		"Nobody in the world can cover my main man Michael Jordan.
|   / \ 		 No, No, Nobody." 	-Mars Blackmon

rlh2@ukc.ac.uk (R.L.Hesketh) (04/11/90)

In article <13388@thorin.cs.unc.edu> markham@rho.cs.unc.edu (Andrew Markham) writes:
>
>I have a viewport whose child is a form widget and I would like to be
>able to tell the viewport where to position itself.

Funny you should say this .. someone here came to me with the same problem,
they wanted to be able to specify a new X and Y for the clipped child.
Currently if you do a SetValues on the child of the Athena Viewport it
refuses the request.  What you need to change is the geometry manager inside
the Viewport to accept the X and Y change request .. funny really, coz
everything is in there to cope with moving the child (there is a
MoveChild(w, x, y) procedure).

I've fixed this in my own version of the Viewport (which uses different
scrolly-bars) .. but as there is a need out there I'll send you diffs for
Athena Viewport and also pass them on to Chris Peterson and see if he
wants to include them.

Richard Hesketh   :   @nsfnet-relay.ac.uk:rlh2@ukc.ac.uk
		  :   rlh2@ukc.ac.uk    ..!mcvax!ukc!rlh2
---                                               
Computing Lab., University of Kent at Canterbury,
Canterbury, Kent, CT2 7NF, United Kingdom.    Tel: +44 227 764000 ext 3682/7620