Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!cs.utexas.edu!sun-barr!newstop!sun!argv From: argv@turnpike.Eng.Sun.COM (Dan Heller) Newsgroups: comp.windows.x.motif Subject: Re: Resizing Message-ID: <144049@sun.Eng.Sun.COM> Date: 23 Oct 90 06:54:02 GMT References: <1990Oct19.175154.28038@dlb.uucp> Sender: news@sun.Eng.Sun.COM Distribution: na Organization: O'Reilly && Associates Lines: 63 In article <1990Oct19.175154.28038@dlb.uucp> cindy@dlb.UUCP (Cindy Holstrom) writes: > BulletinBoard ------------------------------------ > MenuBar | Menu bar | > DrawingArea ------------------------------------ > ScrollBar (horizontal) | Drawing Area | ^ | > ScrollBar (vertical) | | " | > RowColumn (children undefined) | | " | > Label | | v | > | _____________________________| > | <==========================> | > ------------------------------------ > | Row column | > ------------------------------------ > | Label | > ------------------------------------ > > I want resizing of the window to effect only the drawing area. That is, up to > a maximum size, the expanding of the window will cause more of the drawing > area to be exposed. This means that the scroll bars will have to be adjusted > to indicate how much of the drawing area is exposed. There's no reason hypothetically that you can't use a MainWindow widget. The drawing area can be set to be the "work area" and the other stuff can simply be added as you would add any widget as a child of a parent. However, in reality you are going to have other problems because the MainWindow (and many of he other constraint widgets) do not ask children what sizes they would like to be. If they did, everything would work out ok. You could attempt a workaround by creating a resize() action for the RowColumn and the Label to call XtQueryGeomtry() and resize those widgets explicitly in case the MainWindow got resized. You will probably get several resizing flashes--your milage may vary. The problem is, you're going to have a hard time providing a MenuBar without the MainWindow widget without it being resized weirdly. You could try to use a PanedWindow and set the min and max sizes for the RowColumn and Labels -- resizes will therefore affect only the drawing area. Note: your "label" at the bottom could be used as the "message area" of the MainWindow, if you like. I don't recommend using BulletinBoard widgets unless you want to write your own resize routine for it to manage the sizes of the children (which may not be difficult). You could easly use a form and specify the edges (left/right) of each of the widgets be XmATTACH_FORM and the tops set to the widget above using XmNtopAttachment, XmATTACH_WIDGET. > 1. How does the application get notified that the windows/widgets have > been resized? There doesn't appear to be any callbacks for this. Do > I need to have an event handler invoked? Use translations and specify action procedures (you write) to be called when the event takes place. This is not intended to answer your question directly --you're going to have to do some homework w.r.t. looking into XtAppAddActions(). -- dan ---------------------------------------------------- O'Reilly && Associates argv@sun.com / argv@ora.com Opinions expressed reflect those of the author only.