duanev@kauai.ACA.MCC.COM (Duane Voth) (07/25/89)
I'm rather unhappy with a specific feature/bug of the Athena Form widget. I have a widget tree that looks like this: Shell | Form /\ / \ Command Viewport | List The Command widget adds an item to the List widget making it grow and ask the Viewport, Form, and Shell widgets to resize once enough items are added. Command line options let me play with the Shell's XtNallowShellResize resource (-s), the Form's XtNresizable (-r) resource, and the Viewports XtNallowVert (-v) resource. The Shell widget is given an initial size large enough to fit 3 and 1/2 items in the List widget. The combinations of options that I believe work correctly are: no options no widget sizes ever change. -v a scroll bar appears when the List widget out grows its initial space. the Shell, Form, and Viewport widgets never resize. (it sure would be nice if the Form allowed the Viewport to expand horizontally (while still refusing vertical expansion) so that the extra room for the scroll bar didn't chop off the right side of the items) -s -v same as -v. Form widget blocks resize requests from getting to the Shell widget. -s -r -v the Shell, Form, Viewport, and List widgets all resize to display all of the items in the List widget. The combination of options that I believe DON'T work correctly are: -r -v the List widget resizes to contain all the items but is allowed to expand off the bottom of the Shell widget (clipped by the Shell of course). the Form widget never tells the Viewport that there is not enough room for all the items and thus never enables a scroll bar. So, looking at Form.c I found GeometryManager() to be rather simple and decided to look around. Why doesn't the Form's GeometryManager *ever* ask its parent wheather a specific resize is appropriate? *** end of concise problem description *** the rest of this is just rambling... I decided to play with Form.c and added: allowed.request_mode = request->request_mode | XtCWQueryOnly; x = XtMakeGeometryRequest(w->core.parent, &allowed, &stuff); to ask the Shell if it was ok to expand before unconditionally returning XtGeometryYes. (never mind that the allowed.height and allowed.width are for the Viewport widget only instead of *all* of the Form's children - turns out that it doesn't even matter..) Well, XtMakeGeometryRequest() simply returns XtGeometryYes if -s (XtNallowShellResize) was specified and XtGeometryNo if wasn't. In addition, the Shell would change size *twice*, once to the size of the Viewport and then to a size correct for the expanded List/Viewport/Form widgets. I thought XtCWQueryOnly was supposed to prevent this nonsense?! Ok, so I don't know what I'm doing. Any help would be appreciated. -- --- duane voth duanev@mcc.com ---- ALL systems are arbitrary! --- effectiveness is the measure of Truth --
kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (07/26/89)
> So, looking at Form.c I found GeometryManager() to be rather > simple and decided to look around. Why doesn't the Form's > GeometryManager *ever* ask its parent wheather a specific resize > is appropriate? Because it is stupid? Actually its geometry manager is just not clever enough, sigh. > I thought XtCWQueryOnly was supposed to prevent this nonsense?! It would, but the widget has to listen to QueryOnly, and since the shell has been around longer than QueryOnly... In any case this is a known problem in the shell widget. Chris