[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Weird bug -- seen before?
- To: kimb@aisb.ed.ac.uk (Kim Binsted)
- Subject: Re: Weird bug -- seen before?
- From: bill@cambridge.apple.com (Bill St. Clair)
- Date: Wed, 9 Mar 1994 10:22:02 -0600
- Cc: info-mcl
At 4:09 PM 3/7/94 +0000, Kim Binsted wrote:
>Hi. I didn't find this in the FAQ. Has anyone had this problem before?
>I'm trying to put up windows containing text. The chunks of text may
>vary in size, so I was using default positioning. However, default
>positioning seems to work differently (and strangely) with *slightly*
>different bits of text. For example:
The problem was a bug in (method view-default-size (dialog-item)).
It was neglecting to account for newlines in its width computation
(it did account for them in its height computation). This caused
your static-text-dialog-item to be wider than the dialog, which caused
view-find-vacant-position to punt (could also be called a bug, but
not as severe, so I didn't fix it). Why noone has noticed this before
now, I don't know. I'll send you a patch under separate cover. Anyone
else who wants it, please ask for "view-default-size-patch".
-Bill
>
>(make-instance 'dialog
> :window-type
> :document-with-grow
> :view-font
> '("Chicago" 12 :srcor :plain)
> :view-subviews
> (list (make-dialog-item
> 'static-text-dialog-item
> nil nil
>"Welcome to PEP.
>If you want to see this screen again,
>click on the 'help' button."
> nil)
> (make-dialog-item
> 'static-text-dialog-item
> nil nil
>"If y
>prefer, please click on the word SCREEN."
> nil)))
>
>The text in the window is positioned well, ie:
>
> Welcome to PEP.
> If you want to see this screen again,
> click on the 'help' button.
>
> If y
> prefer, please click on the word SCREEN.
>
>But if the second piece of text is changed to:
>"If you
>prefer, please click on the word SCREEN."
>
>The second piece writes over the first, ie:
>
> If you
> prefer, please click on the word SCREEN.
> click on the 'help' button.
>
>WHY??!! Nothing else changes, or is changed. I am confused.
>
>Thanks,
>
>Kim.