[comp.windows.x.motif] Pain resizing XmPanedWindowPanes

krs0@gte.com (Rod Stephens) (04/11/91)

(Running X11R4, Motif 1.1.1 on DECstation 3100)

I am trying to resize the panes in an XmPanedWindow from
within my program. I have set XmNallowResize = TRUE for the
panes and I have set XmNrefigureMode = TRUE for the
XmPanedWindow.

If I try to use XtSetValues to change XmNheight of the
panes, there is no effect.

If I try to use XtMakeGeometryRequest to change the height,
I get XtGeometryNo for an answer.

If I use XtResizeWidget, the child resizes but the pane does
not so the child is chopped at the bottom (if I grow the
child) or I am left with a big empty area (if I shrink the
child):

    +--------------------+
    |+------------------+|
    ||     child 1      ||  <-- shrunk child 1
    |+------------------+|
    |                    |
    |                    |  <-- empty area
    |                    |
    |                    |
    +--------------------+  <-- sash
    |+------------------+|
    ||     child 2      ||  <-- child 2
    |+------------------+|
    +--------------------+

Does anyone know how this is supposed to be done?

+---------------------------------------------------------------+
| Rod Stephens           | "Haven't I told you not to play      |
| GTE Laboratories, Inc  |  with my super-weapons? You might    |
| (617)466-4182          |  devastate yourself!"                |
| krs0@gte.com           |                                      |
+---------------------------------------------------------------+

nazgul@alfalfa.com (Information Junkie) (04/12/91)

> (Running X11R4, Motif 1.1.1 on DECstation 3100)
> 
> I am trying to resize the panes in an XmPanedWindow from
> within my program. I have set XmNallowResize = TRUE for the
> panes and I have set XmNrefigureMode = TRUE for the
> XmPanedWindow.
...
> Does anyone know how this is supposed to be done?

I don't know how it's supposed to be done.  However setting paneMinimum, managing
the child, and then unsetting paneMinimum works pretty well.

Alfalfa Software, Inc.          |       Poste:  The EMail for Unix
nazgul@alfalfa.com              |       Send Anything... Anywhere
617/646-7703 (voice/fax)        |       info@alfalfa.com

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

berlage@gmdzi.gmd.de (Thomas Berlage) (04/12/91)

In article <10969@bunny.GTE.COM>, krs0@gte.com (Rod Stephens) writes:
> (Running X11R4, Motif 1.1.1 on DECstation 3100)
> 
> I am trying to resize the panes in an XmPanedWindow from
> within my program. I have set XmNallowResize = TRUE for the
> panes and I have set XmNrefigureMode = TRUE for the
> XmPanedWindow.

Geometry requests like this not only go to the paned window. The paned
window itself must check with its parent whether resizing the whole
paned window is OK. In this case, you probably need to set
XmNallowShellResize of the nearest shell ancestor to True. There may
even be other manager widgets in the hierarchy that can prevent resizing.

Thomas Berlage (berlage@gmdzi.gmd.de)
GMD, Sankt Augustin, Germany

krs0@gte.com (Rod Stephens) (04/12/91)

In article <4519@gmdzi.gmd.de> berlage@gmdzi.gmd.de (Thomas Berlage) writes:
>Geometry requests like this not only go to the paned window. The paned
>window itself must check with its parent whether resizing the whole
>paned window is OK. In this case, you probably need to set
>XmNallowShellResize of the nearest shell ancestor to True. There may
>even be other manager widgets in the hierarchy that can prevent resizing.
>
>Thomas Berlage (berlage@gmdzi.gmd.de)
>GMD, Sankt Augustin, Germany

Yes! Perfect! The XmPanedWindow was trying to resize itself
to accomodate the pane's resizing and its ancestor was not
allowing it. Setting XmNallowShellResize did the trick.

What I expected it to do was to resize one pane at the
expense of the others, just like it does when the user drags
a sash. This would not require the XmPanedWindow to resize
so XmNallowShellResize would not be a problem.

Now the bonus question: Is there a way to get this to
happen? In particular, is there a way to make the
XmPanedWindow save up child resizes and do them all at once?
Then I could grow window 1 and shrink window 2 by the same
amount to get the desired effect. (When I do this now there
are ugly redrawing effects.)

+---------------------------------------------------------------+
| Rod Stephens           | "Haven't I told you not to play      |
| GTE Laboratories, Inc  |  with my super-weapons? You might    |
| (617)466-4182          |  devastate yourself!"                |
| krs0@gte.com           |                                      |
+---------------------------------------------------------------+