Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!ames!pasteur!cory.Berkeley.EDU!dheller From: dheller@cory.Berkeley.EDU (Dan Heller) Newsgroups: comp.windows.x Subject: Re: Xaw Box infinite recursion bug Message-ID: <13538@pasteur.Berkeley.EDU> Date: 10 May 89 05:45:09 GMT References: <7498@spool.cs.wisc.edu> Sender: news@pasteur.Berkeley.EDU Reply-To: dheller@cory.Berkeley.EDU.UUCP (Dan Heller) Organization: University of California, Berkeley Lines: 34 In article <7498@spool.cs.wisc.edu> stuart@rennet.cs.wisc.edu (Stuart Friedberg) writes: > DoLayout (Box.c) can go into infinite recursion > REPEAT BY: > Set vSpace and hSpace resources to (Dimension)65535 (aka -1). > *** Be prepared to reboot to recover control on a Sun 4/110. *** > On machines with larger shorts, use a larger value. I get the same problem all the time, but not because of negative, or even "unreasonable" values, but because h-space and v-space is set as well as width and height being set to incompatible values with the width and height of widgets within the box. for example, the "box" likes to layout items in the box vertically by default. I've found that you can force horizontal layout if you specify a width to the box when it is created. this width should be width enough to handle (be greater than or equal to) the sum of the total widths of the widgets within + h-space of the box. the height should be great-than or equal-to the max height of a widget in the box but not bigger than the height of the sum of any two widgets therein. still with me? the point is, I want to specify some width and height of the box such that when the items are laid out within, the box (DoLayout) doesn't try to stack the widgets any differently than left-right. If you make a subtle error here than you will get either an incorrect (unintended layout pattern) or the infinite recursion bug mentioned. It depends on the mood of the system. :-) (I haven't tested it close enough to see where the problem really lies.) You can see this problem if you twiddle the h-space value a little in the boxWidget provided in the same program "prompt.c" in the WidgetWrap code on expo. Dan Heller