Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!pcrat!rick From: rick@pcrat.uucp (Rick Richardson) Newsgroups: comp.windows.x.motif Subject: Stretchable List Message-ID: <1990Jul16.172955.11321@pcrat.uucp> Date: 16 Jul 90 17:29:55 GMT Organization: PC Research, Inc. Lines: 97 I'm trying to make a Form that contains some buttons at the top, and a scrollable list of things at the bottom. If the User resizes the form, I want the scrollable list to change size so that it fills the form completely, except for the area occupied by the buttons at the top. E.G. I want the form to look like this no matter how big or small the window is: +-------------------------+ | Button | +-------------------------+ | Item N ^ | | Item N+1 | | | Item N+2 | | | Item N+3 v | | <--------------------> | +-------------------------+ I've tried a couple things. If I use a SelectionBox, the list portion stretches automatically in the horizontal direction, but not vertically. Plus, I just want the list portion, anyhow. If I used the SelectionBox, I'd want to tell it (somehow) to make visibleItems variable, and forget the Text area and Buttons. Using a ScrolledList, I can't get either dimension to stretch with the form. I fooled around alot with the policies. PLUS, the widget positions itself *under* the button, as if the button had 0 height, even though the attachment constraints are the same as for the SelectionBox I tried. That might be a bug. Perhaps these widgets just aren't appropriate. Perhaps I need to use some callbacks. Any suggestions will be gratefully received. I'm enclosing the (bare minimum) .uil file so you can better see what I've tried. All this is using Motif 1.0. -Rick Richardson module prototype version = 'v1.0' names = case_sensitive include file 'XmAppl.uil'; object ft_main : XmForm { controls { XmPushButton button1; ! ! Comment out one or the other ! XmSelectionBox try_sel; ! XmScrolledList try_list; }; arguments { XmNwidth = 300; XmNheight = 300; }; }; object button1 : XmPushButton { arguments { XmNtopAttachment = XmATTACH_FORM; XmNleftAttachment = XmATTACH_FORM; XmNrightAttachment = XmATTACH_FORM; }; }; object try_selbox : XmSelectionBox { arguments { XmNtopAttachment = XmATTACH_WIDGET; XmNtopWidget = XmPushButton button1; XmNleftAttachment = XmATTACH_FORM; XmNrightAttachment = XmATTACH_FORM; XmNbottomAttachment = XmATTACH_FORM; XmNlistVisibleItemCount = 5; }; }; object try_list : XmScrolledList { arguments { XmNtopAttachment = XmATTACH_WIDGET; XmNtopWidget = XmPushButton button1; XmNleftAttachment = XmATTACH_FORM; XmNrightAttachment = XmATTACH_FORM; XmNbottomAttachment = XmATTACH_FORM; XmNvisibleItemCount = 5; XmNscrollBarDisplayPolicy = XmSTATIC; XmNlistSizePolicy = XmCONSTANT; XmNvisualPolicy = XmCONSTANT; }; }; end module; -- Rick Richardson - PC Research, Inc., uunet!pcrat!rick, (201) 389-8963