// ---- End Project Data ---- // ---- File main.t ---- // Before Script for "_view000" // Copyright 1993-1994 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: protoApp }; _view001 := /* child of _view000 */ {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 print("a word was recognized!"); :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 }; _view002 := /* child of _view000 */ {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 }; // ---- Beginning of section for non used Layout files ---- // End of output