[NTLK] ProtoGlance - how to get it to work?

Chris Rupnik chris.rupnik at gmail.com
Fri Jan 14 11:49:41 PST 2022


Hi
 I am having some difficulty understanding how to implement the protoglance 

 The newton programmer reference guide 2.0 offers this snippet of code to implement 

 
myGlance := {...
_proto:           protoglance,
text:             "Just a glance...",
viewIdleFrequency:5000,
viewfont:         ROM_fontSystem9Bold,
viewJustify:      vjCenterV+vjCenterH,
...};

showGlance := {... // Button that opens the glance view
_proto:           prototextbutton,
text:             "Show it",
ButtonClickScript: func()

   myGlance:Open(),
   };


I do not understand how to actually implement such code snippets in my project. When i try to export what i have created via a text file in the NTK - i get the following - which doesn’t match what is written above. 

PushMe :=
    {
     buttonClickScript:
       func()
       LookMe:Open(),
     text: "Dare You",
     viewBounds: {left: 128, top: 48, right: 188, bottom: 60},
     debug: "PushMe",
     _proto: @226 /* protoTextButton */
    };
AddStepForm(AllAboutTheBaae, PushMe);



LookMe :=
    {text: "Boom!",
     viewBounds: {left: 33, top: 49, right: 107, bottom: 59},
     debug: "LookMe",
     _proto: @183 /* protoGlance */
    };
AddStepForm(AllAboutTheBaae, LookMe);

How can you easily enter in the example code above into a project? perhaps that is the part that i am missing. Whereas the code compiles fine without error - execution on the newton fails naturally when you push the button - an error occurs. 

Chris



More information about the NewtonTalk mailing list