Re: [NTLK] [PROG] Getting a protoPicker to display - makePickLine and LocalBox()

From: Simon Bell (simonbell_at_mac.com)
Date: Mon Nov 15 2004 - 11:57:25 PST


On 12 Nov, 2004, at 8:05 am, Jim Witte wrote:

> func(arg1, arg2, arg3)
> begin
> local Local1, local2, local3;
> Arg1 := :LocalBox();
> [..]
>
> Why is Arg1 an l-value for an assignment function? Why have it as a
> parameter if it's going to immediately be replaced? And it's *called*
> with a first parameter of :LocalBox() anyway from the
> viewSetupChildrenScript, wasting a call to LocalBox!

This wouldn't be the only occasion on which the Newton engineers didn't
get it quite right ;)

On 12 Nov, 2004, at 6:41 am, Paul Guyot wrote:

> Is it Simon's code?

Okay, so it's not directly my code, but I see what you're trying to do.
I think 'the right thing' to do is add an ellipsis to the text if it
would exceed the subject line. Override the subject's
protoTextPicker:textSetup()

func()
begin
if fields.title = nil then
        "Untitled"
else if fields.title = 'multiple then
        "Multiple Items"
else
        begin
        indent := StrFontWidth(label, labelFont) + 6;
        StyledStrTruncate(Clone(fields.title), :LocalBox().right - indent,
entryFont)
        end
end

(Yet another call to :LocalBox()!)

This is what I'll be doing in the next release of Mail V. I don't
support SimpleMail any more - indeed I shall shortly be making it
obsolete :)

Thanks for pointing out the UI 'feature'!

Simon

-- 
This is the NewtonTalk list - http://www.newtontalk.net/ for all inquiries
Official Newton FAQ: http://www.chuma.org/newton/faq/
WikiWikiNewt for all kinds of articles: http://tools.unna.org/wikiwikinewt/


This archive was generated by hypermail 2.1.5 : Mon Nov 15 2004 - 12:30:01 PST