Path: utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!udel!rochester!PT.CS.CMU.EDU!sei!kwh From: kwh@sei.cmu.edu (Kurt Hoyt) Newsgroups: comp.windows.x Subject: Re: X Toolkit question/problem Message-ID: <7@di.sei.cmu.edu> Date: 17 Mar 88 14:56:37 GMT References: <7753@agate.BERKELEY.EDU> Organization: Carnegie-Mellon University (Software Engineering Institute), Pgh, PA Lines: 34 Summary: Why the top level does not resize In article <7753@agate.BERKELEY.EDU>, rusty@velveeta.berkeley.edu writes: > top = XtInitialize("top", "XTools", ...) > main_form = XtCreateWidget("main", formWidgetClass, top, ...) {stuff deleted} > confirm_form = XtCreateWidget("confirmForm", formWidgetClass, top, ...) {stuff deleted} > When the quit button is pressed the quit_button callback does: > > XtUnmanageChild(main_form); > XtManageChild(confirm_form); > > I was hoping that the top level shell would resize itself when the {stuff deleted} > Am I doing something wrong or is this a bug or is that just the way > it is? You are doing something wrong. The top widget must have its allow_shell_resize attribute set to TRUE (it is FALSE by default). Add this after your XtInitialize: XtSetArg(args[0], XtNallowShellResize, TRUE); XtSetValues (toplevel, args, 1); This will allow the top level widget to resize itself when necessary. The toolkit seems to default all resize attributes to FALSE. I ran into the same thing with a label on a form -- when I changed the label text, the label did not resize until I set its resizable attribute (see the Athena Widgets doc, page 30) to TRUE.