Re: Choose from list change in AS 1.5.5
Re: Choose from list change in AS 1.5.5
- Subject: Re: Choose from list change in AS 1.5.5
- From: Chris Nebel <email@hidden>
- Date: Thu, 15 Feb 2001 13:56:45 -0800
- Organization: Apple Computer, Inc.
Paul Berkowitz wrote:
>
[painfully detailed analysis deleted...]
>
>
These figures are all so close to each other, that I expect they
>
restrictions are relative, not absolute. The short version is:
>
>
"If you put a carriage return into your prompt, there will be trouble."
Bingo. The real problem is that "choose from list" doesn't use anything even
resembling a line-breaking algorithm to figure out how many lines the prompt
is: it just calls StringWidth and divides by the width of the dialog (which
depends on how long the list items are; see below.) This means that (1)
depending on how the word wrapping works out, you might lose a couple of words
off the end, and (2) because StringWidth considers carriage returns to take up
no space, you get completely incorrect results if the prompt contains one.
>
> The maximum number of items displayed in the list, without activating the
>
> scroll bar, is 26.
>
>
That's about 15 better than it was pre OS-9.1 (max was 11, if I remember
>
correctly.)
It depends on your screen size, actually. AppleScript 1.4 always used a list
big enough for 12 items, no matter how many items you gave it. 1.5.5 adjusts
the height of the dialog to show all the items that will fit. As Michelle
pointed out, it doesn't take the prompt height into account, so a very long
prompt combined with lots of short items will push the buttons off the bottom
of the screen.
It's too late to fix any of this for 1.6, but I've filed appropriate bugs.
--Chris Nebel
AppleScript Engineering