// Copyright © 1993-94 Apple Computer, Inc. All rights reserved. constant kAppSymbol := '|TandL:PIEDTS|; // ---- End Project Data ---- // ---- File main.t ---- myBase := {title: "Application", viewBounds: {left: -1, top: 2, right: 233, bottom: 330}, viewSetupFormScript: func() begin local a := GetAppParams(); self.viewBounds := RelBounds(a.appAreaLeft, a.appAreaTop, a.appAreaWidth, a.appAreaHeight); end, _proto: protoApp, debug: "myBase" }; theTable := /* child of myBase */ {def: protoTableDef, viewSetupFormScript: func() begin // first clone off a copy of the table definition to avoid Read only errors def := Clone(def); // setup the number of entries in the table def.tabDown := 3; //add an array of text values for each of the table entries def.tabValues := ["Gallifrey", "Mutters Spiral", "Shada"]; // now make each entry as wide as the interior of the table def.tabWidths := (viewBounds.right - viewBounds.left) - 2 ; end, viewBounds: {left: 12, top: 30, right: 222, bottom: 140}, viewFlags: 513, viewClickScript: func(unit) begin print("CLICK"); nil; end, selectThisCell: func(which) begin if lastSelection = which then begin // deselect the selection which:Hilite(nil) ; lastSelection := nil ; SetRemove(selectedCells, which.vIndex) ; end; else begin // call the inherited message to get the correct // selection behavior inherited:selectThisCell(which); lastSelection := which ; end; // this is where you do your housekeeping stuff print("selectThisCell called") ; print("selected cell (h,v): (" & which.hIndex & "," & which.vIndex & ")"); end, lastSelection: nil, _proto: protoTable, debug: "theTable" }; theList := /* child of myBase */ {viewBounds: {left: 13, top: 157, right: 223, bottom: 280}, viewSetupFormScript: func() begin self.listItems := ["one", "two", "three"]; :SetupList(); end, viewFont: ROM_fontSystem9, viewLines: 6, buttonClickScript: func(textIndex) begin if textIndex = lastSelection then begin lastSelection := nil ; // These next two lines clear out the selection! selection := nil ; :dirty(); end; else lastSelection := textIndex ; print(textIndex); end, lastSelection: 0, _proto: protoTextList, debug: "theList" }; // ---- Beginning of section for non used Layout files ---- // End of output