Using Newt

Getting Started

Where to Find Newt, Slurpee, NewtATut, NewtTurT,

Presumably, you have already located this page or obtained Newt. My releases page has the most current information about versions.

Installation

Exploring Newt's Application Personality

Try the following (see also the NewtATut interactive tutorial). You should have NewtPack installed (see packages.htm) if you want to be able to Save your application.

Hopefully, you have followed these steps correctly/successfully, and have a functioning application. If you have NewtPack installed and your application is visible,

If you have the sources for an application in the current folder (transferred via Slurpee, or copied from NewtATut), you can rebuild the application later from these sources by Evaluating the expression: :doObj('build, 'myApp)

(The 2nd arg is the app symbol -- first line of application object definition).

Exploring Newt's Turtle Personality

This is described in turtle.htm and requires the NewtDraw plugin to be installed; also see NewtTurT tutorial book

Interface Guide

The following sections cover the major interface areas of Newt -- the views available by tapping overview (the dot between the two fixed scroll arrows at the bottom of the screen).

Main View (Edit Objects/Methods)

This is the initial screen where you browse and edit objects and methods. Other views (windows) are used for drawing, printing, building applications, and as control palettes.

overview
Tap the overview dot (between the fixed scroll arrows at center bottom) to pop up a list of current views, containing built-in views such as About Newt, and Eval Log, palettes such as Eval Controls, packages such as Slurpee (if installed), and any user-created applications, e.g., Hello World. You can also add NTK apps/books to this list. If you have installed plug-ins such as NewtDraw or ExprKbd, other entries may appear.
scroll arrows
In Edit Methods (Main View) or Eval Log (if visible), the main text field scrolls.
folder tab (top of screen)
Newt uses the folder label for organizing "newts" for Save in Edit Methods (Main View), Eval Log, and About Newt (and Newt Drawing, if installed). Newt "compiles" (i.e., makes an executable version of) methods and checks objects found in the current folder, and notes errors (if any) in Eval Log.
drag dot (top center)
drag Newt application on larger screens (e.g., MessagePad2000, eMate300)
source name
The name of current object, method or page appears in a "picker list", preceded by a diamond. (Status messages may appear here also).
action button (routing/envelope icon)
You can Save and Revert, Duplicate, Delete current source. You can also copy templates from a library folder -- see later action button descriptions. Newt does not currently provide a filing button -- however, you can look at, reorganize, print, fax, beam etc. your saved newts (source, screen snapshots, print results, registration form) outside Newt in the generic Notepad application.

We will now cover the other palettes and views, and return to editing and creating methods later under Edit Methods (continued).

Eval Controls

The following controls are found in a floating, draggable palette, located initially at the bottom of Newt's screen: Eval field, Expr, keyboard icon, Eval button, Print?, and Save. As a general rule, you will want to keep Eval Controls visible, rather than closing and re-opening it.

Eval field
This field can contain a short program in NewtonScript. Tap the Eval button to execute it. Techniques for entering expressions include combinations of
Expr
A popup list of sample expressions appears -- you can customize this. If you select an expression, it appears in the Eval field. You can then edit it, and/or tap the Eval button to execute.
keyboard icon
This toggles (either shows or hides) a floating alphanumeric keyboard that does not prompt for additions to the dictionary. You can double-tap in the Eval field for the standard keyboard.
Eval button
Tap the Eval button to evaluate (compile and execute) the expression in Eval field. The button remains highlighted during execution. (During interruptible methods, e.g., squiral2, it changes to Stop and you can tap it to terminate execution.) If you spell something incorrectly, or use incorrect parameters or syntax, Eval Log (or a system error box) will appear with a somewhat cryptic error message or code (see Errors). You can add additional error messges via the ErrCnst plug-in. Basically, you will have to compare what you wrote more carefully against the example, edit it and try again. (Other info and examples available to registered users).

Warning: Neither Newton nor Newt provide a general interrupt capability . So, unless you like using the manual reset button in the back, use common sense in choosing values for iteration, recursion or distance that are not "too large" . I will generally provide some reasonable values to try. Newt's default behavior is to finish executing the entire expression before checking for user actions like button taps. There is a facility provided in Newt to replace the NewtonScript "for" iteration construct. This facility executes each step in the background, allows you to interrupt Newt, and is covered in the manual.

Print?
If checked (default: no), the Eval Log view pops up with expression and results after you tap the Eval button. Error messages will appear regardless of this setting. If you have Slurpee connected as an Inspector, print and error results appear in your desktop terminal emulator.
Heap
The first time you tap this, the Newton begins to display the amount of heap remaining & updates every ~10 seconds. If you tap again, it immediately does a "gc" (garbage collect) which should increase the number. To turn off, close Eval Controls, then re-open it from the overview menu.
Save
The current (top) view is saved, usually to the Notepad under the current folder tab category. For Edit Methods, the method source, if edited, is saved (same as Save under action button) if there are no errors. For About Newt, a text registration form is saved. For Eval Log, the current printed results are saved. For Newt Drawing, the current drawing, if any, is saved. A user application is saved either as a package if NewtPack is installed). If the view is not recognized as an "application", Newt beeps.

Newt Drawing

Newt Controls

About Newt

Select this via overview (or info button). Tap Save in Eval Controls to create a registration form in Notepad under the current category (see folder tab) for later printing, mailing, etc. Or, tap the $ button in order to register and pay electronically if you have the Register application.

ExprKbd

If ExprKbd plug-in is installed, this is a separate floating, draggable palette accessible via overview, located initially on the right hand side of the screen. This can be used for Eval field, but is most useful for source in Edit Methods (Main View). As you select items from the text list, an expression is inserted into your current source along with syntax for a function, method or slot. Customizing this list is described in the manual (or you can change the plug-in tool itself by modifying the exprkbdt.nwt example).

Eval Log

See earlier comments under folder tab, scroll arrows, Print? and Save.

Slurpee, NewtATut, NewtTurT, etc.

If Slurpee is installed, it will also appear in the overview list. If you have started Newt from NewtATut or NewtTurT, titles for these books will appear here also. You can also add other NTK packages (apps and books) for convenience.

Your Applications

overview also contains the titles of applications you are currently developing within Newt, based on source methods. Once you Save the application as a package, it is available separately in Extras.

Edit Objects/Methods (continued)

We now complete coverage of the interface by revisiting the main view.

source names
A "picker" at the top preceded by a diamond contains methods, objects and pages defined in current folder (see folder tab). The diamond disappears during editing (see Save, Revert). Status messages for lengthy operations (Checking,Deleting, Copying) sometimes appear here. You can also select one of the "new" names at the top of the menu to create a default template.
source text
As in the Eval field, you can use handwriting, copy&drag and keyboards to edit your method, object or page source. You can change its name by editing. You can Save, Revert, Duplicate or Delete it via the action button on right. Conventions for different kinds of methods and objects and NewtonScript syntax described in the manual. Also look at graphic0.nwt and applic0.nwt for examples.
action button
Note: "..." after a command indicates that a popup menu or confirm dialog will follow. If command beeps, then it's probably illegal in current context -- you may need to do a Revert, or Select Library first.
Save
Assuming that the source name is valid, does not conflict with a pre-defined "system" method, and successfully compiles, the method source is saved (created or updated) as a "newt" (i.e., text Note) in the current folder. Errors, if any, are noted in Eval Log, with the line of source indicated by the error message. Newt saves only valid sources. So, if you cannot figure out a compile error from the cryptic message, you could either Revert to the earlier version, or comment out offending code (precede individual lines with //, or wrap a section with /* */), so that you can Save for now, get on with your life, and look at it later. Methods are defined immediately; other objects are only checked but can be added explicitly later, e.g., via :doObj.
Revert
If you have unsaved changes, the diamond in front of the source name disappears. Revert returns to the last version saved of the original method in the current folder, or to the basic template.
Add(Obj)
If you have a source for an object in the editor, this adds the object to your application. If the first line is "myApp+aButton", this is equivalent to :doObj('add, "myApp+aButton"). (This assumes you've added "myApp" earlier.)
Build(App)
If you have a source for any object from an application visible in the editor, this does a build of your application (adds application and all of its child objects). If the first line is "myApp+aButton", this is equivalent to :doObj('build, 'myApp) -- it adds "myApp", then "myApp+aButton", etc.
Duplicate
This makes a copy of the current source. Give it a new name (no duplicate names allowed) before Saving.
Delete
Deletes current source from Notepad. It also deletes defined Newt method (if any) but does not delete objects from an application. No confirmation.
Delete All...
Deletes all current items from the current Notepad folder. It confirms first.
Select Library...
Pops up a list of available Notes folders, library plug-ins, e.g., applic0.pkg (you can create these library packages directly from Newt itself), Paperback books, and Personal Media workspaces.
Copy Source... (formerly "Copy from")
Pops up a list of available sources in current plug-in. Copies source for selection to the editor; to save to Notepad, make an editing change, possibly changing the name, then Save. This could be useful for libraries of templates.
Copy All...
Copies all sources from current library to current folder. It confirms first. You may wish to do Delete All first.
Remove Package...
Pops up an alphabetical scrolling list of currently installed packages. This can be convenient for getting rid of packages that you no longer need (note: if you delete any of Newt's plug-ins while in Newt, be prepared to quit immediately afterward; otherwise, you may encounter a memory error). If you attempt to save a package whose name (appSymbol) already exists, Newt will prompt you about removing it before proceeding (so, need to remove it first yourself).

Preferences

Newt saves your preferences for Print? and folder tab and others (including Pen, Color, Newt? for NewtDraw) in a small "system soup" frame that persists across Newt sessions. If you no longer need Newt, you can remove this preferences frame via a soup utility (like StewPot) or directly from Newt (evaluate EntryRemoveFromSoup(prefsEntry) just prior to exiting Newt).

Some preferences are available via the "i" (info) button. This is at lower left.

About
opens the About box
Prefs
autoLoad
automatically load(check) current folder when starting Newt
askWords (omitted in -2 version)
flag for DontAsk plugin
doConfirm
ask for confirmation for major operations (Copy All, Delete All)
closeConfirm
upon closing Newt
noConfirm
just quit (don't ask)
editedConfirm
ask only if current source has not been saved
alwaysConfirm
always ask
autoHeap
turn on the "heap" status (in Heap button) automatically
heapFreq
frequency (in milliseconds) for updating Heap status (if on)
newtFont
simpleFont9, simpleFont10, simpleFont12, userFont9, userFont10, userFont12 (or could allow user specified?; note: this does not change viewLineSpacing in edit area, Eval Log, or Eval Field)
printRefresh
force screen refresh after printing of each item in Eval Log
Rotate (-2 version only)
rotate screen
Version
prints version information about Newt and plugins. same as :version(nil); assumes Print? or Slurpee/NTK Inspector

Also, if you have used RUNewt earlier, this is no longer needed since 3.0 -- so, you can remove the "RUNewt:TKnollSys" package. If you are careful, you can remove the "RUNewt:Apps:TKnollSys" soup, and the "RunNewtRun:TKnollSys" system preference with a soup utility.


Last updated: 24 Nov 96


Steve Weyer - weyer@netaxs.com