Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!pasteur!helios.ee.lbl.gov!epb2.lbl.gov!envbvs From: envbvs@epb2.lbl.gov (Brian V. Smith) Newsgroups: comp.windows.x Subject: Re: Automatic relayout/resize of Athena Form Widget Keywords: athena form widget Message-ID: <2689@helios.ee.lbl.gov> Date: 20 May 89 00:52:16 GMT References: <889@utkcs2.cs.utk.edu> <885@utkcs2.cs.utk.edu> Sender: usenet@helios.ee.lbl.gov Lines: 36 In article <889@utkcs2.cs.utk.edu>, battle@alphard.cs.utk.edu (David Battle) writes: > >Now comes the problem. When I delete one of the subordinate ... widgets > >with XtDestroyWidget, the parent form widget resizes itself smaller. This > >is to be expected, I suppose, except that it seems to over do it. It then > >proceeds to reduce the ... size of each of the remaining subordinate > >... widgets. This continues happening each time I destroy a subordinate > >... widget until some minimum ... size for each sub[widget] is aparently > >reached. At this point, it is impossible to read the text inside the ... > >widgets because they are so [small]. > [ program follows to demonstrate the shrinking widget ] I have found that in working with widgets one must "chain" them to the parent widget, or they get hosed when sizes change. I added the following arguments to command_args[] and it works pretty well (when you destroy the subwidgets the parent doesn't get any smaller, which is what was happening before adding these constraints). I confess that there may be a more appropriate way to do this, but this seems to work. static Arg command_args[] = { { XtNfromVert, (XtArgVal) NULL }, { XtNcallback, (XtArgVal)callbacks }, { XtNwidth, (XtArgVal)130 }, { XtNtop, (XtArgVal)XtChainTop}, { XtNbottom, (XtArgVal)XtChainTop}, { XtNleft, (XtArgVal)XtChainLeft }, { XtNright, (XtArgVal)XtChainLeft }, }; _____________________________________ Brian V. Smith (bvsmith@lbl.gov) Lawrence Berkeley Laboratory We don't need no signatures!