// Text of project WordArray written on 5/9/95 at 4:10 PM // Beginning of file main.t // Before Script for "_view000" // Copyright 1993-1995 Apple Computer, Inc. All rights reserved. _view000 := {title: "WordArray", viewBounds: {left: 0, top: 2, right: 236, bottom: 326}, viewFormat: 83951953, viewSetupFormScript: func() begin local b := GetAppParams(); constant kMaxWidth := 240; constant kMaxHeight := 336; viewBounds := RelBounds(b.appAreaLeft, b.appAreaTop, Min(b.appAreaWidth, kMaxWidth), Min(b.appAreaHeight, kMaxHeight) ); end, _proto: @157 }; _view001 := {viewFlags: 114177, viewFormat: nil, viewBounds: {left: 0, top: 72, right: 240, bottom: 304}, viewWordScript: func(unit) begin ourWords := GetWordArray(unit); // list of likely words ourScores := GetScoreArray(unit); // list of 'confidence' scores :Dirty(); // clear our view and eventually redraw our new words true; //This should return TRUE if you handled the word end, ourWords: nil, viewDrawScript: func() begin local item, index; local vertical := 20; if ourWords then foreach index, item in ourWords do begin :DrawShape(MakeText(item && ": " && ourScores[index], 10, vertical, 200, vertical + 20), nil); vertical := vertical + 20; end; end, ourScores: nil, viewClass: 74 }; AddStepForm(_view000, _view001); _view002 := {viewFlags: 1, viewFormat: 257, viewLineSpacing: 10, viewFont: simpleFont9, viewBounds: {left: 24, top: 24, right: 216, bottom: 72}, text: "Write somewhere below this text. In the viewWordScript, the GetWordArray() and GetScoresArray() functions retrieve the recognition information: words and their 'confidence scores' (lower is better)" , viewClass: 81 }; AddStepForm(_view000, _view002); constant |layout_main.t| := _view000; // End of file main.t