[comp.windows.x.motif] Bottom window in PanedWindow starts off huge - need help

simon@sco.COM (Simon Tooke) (01/18/91)

Hello.  I am using the Motif Paned Window (the widget where children
are stacked vertically and separated by a control sash that the user
can move up and down).  I have two children.  Although the top one in
my REAL application is more complex, let's say they are both Scrolled
Text windows (the top one is actually a scrolled window).  When this
monster comes up on the screen, the control sash is up at the top of the
paned window, the top edit window is squished to invisibility, and the
bottom window takes up all the space.  How can I control where the sash
goes?

	+--------------------------------------+
	+----------------------------------[]--+
	|                                      |
	|         bottom edit widget           |
	|                                      |
	+--------------------------------------+


My other problem is how do I move the sash and set maximum sizes on
the fly?  I've been setting constraint resources on the children of
the paned window (i.e. my two scrolled text windows), but to no
avail.  Anybody with a couple of tips?


-simon tooke


-- 
===============================================================================
Simon Tooke       SCO Canada, Inc. (formerly HCR Corporation)    (416) 922-1937
130 Bloor St. West. Suite 1001, Toronto, Ontario, Canada 
...!scocan!simon	...!uunet!scocan!simon

nazgul@alfalfa.com (Kee Hinckley) (01/31/91)

> Text windows (the top one is actually a scrolled window).  When this
> monster comes up on the screen, the control sash is up at the top of the
> paned window, the top edit window is squished to invisibility, and the
> bottom window takes up all the space.  How can I control where the sash
> goes?
...
> 
> My other problem is how do I move the sash and set maximum sizes on
> the fly?  I've been setting constraint resources on the children of
> the paned window (i.e. my two scrolled text windows), but to no
> avail.  Anybody with a couple of tips?

Oooh boy.  When you find out, please let me know.  Here are some
tips.  First of all, make sure you are setting the constraint resources
on the parent of the widget returned from XmCreateScrolled..., since
that's the scrolled window and the actual child of the paned widget.
Secondly, I believe that those resources may only be checked at manage
time, which would be wrong, but I might be wrong on that one.  The one
situation that I have managed to make work is if you want the first
item to come up according to the constraints and the subsequent one
to fill in the remaining space.  However (according to the comments
in my code) the only way I could make this work was to manage the
paned window, let it return to the main loop, and then manage the
children.  I've thought of playing with misusing the insertChild
callback to try and size the children, but I have a feeling that won't
work.  Any other ideas would be appreciated.