[NTLK] [PROG] Getting a protoPicker to display..

From: Jim Witte (jswitte_at_bloomington.in.us)
Date: Wed Nov 10 2004 - 22:32:07 PST


Programming question (hence the subject line),

   How do I get a protoPicker to actually display? I've got a very
simple app, with a protoFloatNGo base, with a protoPicker and a
protoStaticText in it. When I created the protoPicker, it shows up
with a 'bounds' slot all set to zeros, which it apparently sets to
match viewBounds in the afterScript (why doesn't it just use viewBounds
like eery other proto?) However, it doesn't display when I compile it
(nor does any protoPicker child view show up in ViewFrame). I've tried
manually setting the bounds slot, and disabling the afterScript, which
doesn't work.

   What I'm trying to do is this: to make a replacement picker proto
and put stick it into the proto slot of the subject field of the
SimpleMail routingSlip, which is the slot 'subject' and has a
SimpleMail custom proto (called subject, appropriately enough) that
defines its own textSetup and PopIt methods.

   What the new proto would do is to add a little arrow at the right
edge of the text line if the line was longer than the view width.. :)
(by rewriting the makePickLine method) I still don't quite know how to
get the proto into *only* the appropriate line of simpleMail - unless I
wanted to alter all the protoPickers, where a global modification would
work (can I redirect a magic pointer in NS?)

   Something that looks odd in the proto is that the makePickLine script
is this (from ViewFrame):

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!

   But for now I just need to get the protoPicker to display at all..

Jim

-- 
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 : Thu Nov 11 2004 - 23:00:01 PST