// ---- End Project Data ---- // ---- File TextList.t ---- // Before Script for "baseView" // Copyright 1993-1994 Apple Computer. All rights reserved. baseView := {title: "TextList", viewBounds: {left: 0, top: 0, right: 240, bottom: 336}, 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, debug: "baseView" }; Info := /* child of baseView */ { text: "This is an example of how to use the protoTextList. In this case we will list all the available printer types and select one of them." , viewBounds: {left: 10, top: 26, right: 218, bottom: 74}, viewJustify: 0, _proto: protoStaticText, debug: "Info" }; theList := /* child of baseView */ {viewBounds: {left: 27, top: 115, right: 201, bottom: 193}, viewSetupFormScript: func() begin listItems := Array(0, nil); // create the array in RAM // get a list of available printers and place these in the listitem array foreach value in AvailablePrinters do begin AddArraySlot(listItems, value.name); end; :SetupList(); end, viewFont: simpleFont9, viewLines: 6, buttonClickScript: func(textIndex) begin print("Selected the following index =" &&textIndex); // now set the result field as well, and open/close it for the effect theResult:Close(); SetValue(theResult, 'text, listItems[textIndex]); theResult:Open(); end, listItems: nil, viewJustify: 0, _proto: protoTextList, debug: "theList" }; ResultLabel := /* child of baseView */ {text: "You selected:", viewBounds: {left: 26, top: 210, right: 202, bottom: 234}, _proto: protoStaticText, debug: "ResultLabel" }; theResult := /* child of baseView */ {text: "Nothing selected yet\u2026", viewBounds: {left: 26, top: 250, right: 202, bottom: 282}, viewFormat: 304, viewEffect: 44435456, _proto: protoStaticText, debug: "theResult" }; // View theResult is declared to baseView // ---- Beginning of section for non used Layout files ---- // End of output