Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!uflorida!gatech!bloom-beacon!ATHENA.MIT.EDU!kit From: kit@ATHENA.MIT.EDU (Chris D. Peterson) Newsgroups: comp.windows.x Subject: Re: Geometry management philosophy/procedure Message-ID: <8901112355.AA18650@DORA.MIT.EDU> Date: 11 Jan 89 23:55:04 GMT References: <8808@burdvax.PRC.Unisys.COM> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 61 > ...has a form that contains three horizontally stacked text > widgets and another form at the bottom of the whole mess. In the bottom > form are a row of label widgets and two row of buttons. There are 10 > buttons placed side by side. I assume that you mean vertically stacked labels? If this is the case then you may gain better behavior by using a vpaned widget instead of a form for your topmost widget in the tree. > What I want to happen is the that the size of the application is > controlled by the text in the largest button. ??? I assume you are trying to get this? ---------- ---------- ---------- ---------- | label | | foo | | a | |long one| ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- | button | | button | | button | | button | ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- | button | | button | | button | | button | ---------- ---------- ---------- ---------- There is not currently a widget in the athena widget set that will allow this to happen, I have found that an application widget that makes all children the same width as the longest child will do the proper thing, although it is a hack. Make sure to tell all the buttons not to automatically resize themselves (there is a resource for this in X11R3). > Another feature I would like that complicates things a little more is > have my text widget be a fixed number of lines in height instead of a > fixed number of pixels. The "right" solution is to be able to specify the height of the text widget in lines as well as pixels, but since the Athena text widget does not let you do this you must either hack it in, or do something like the following: Specify a default font in an application defaults file, and the height of the text widget (in pixels) that give you the number of lines that you want. This will work correctly as long as the user does not change the font. If he does he is also able to change the height of the text widget so that it will look right. The advantage to this method is that is allows the user to display a different number of lines than the default, (i.e this not as friendly, but more flexible). Chris D. Peterson MIT X Consortium / Project Athena Net: kit@athena.mit.edu Phone: (617) 253 - 1326 USMail: MIT - Room E40-321 77 Massachusetts Ave. Cambridge, MA 02139