home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-04-16 | 1.2 KB | 40 lines | [TEXT/ToyS] |
- property theVals : ["one", "two", "three", "four", "five", "six", "seven"]
-
- dd install font {name:"Geneva", size:9} with greyscale
- MakeDialog()
- repeat while (dd count dialogs) > 0
- DoUpdate()
- set i to dd interact with user
- if i = 4 then
- else if i = 1 then
- MakeDialog()
- else if i = 2 then
- dd delete dialog 1
- else if i = 3 then
- exit repeat
- end if
- end repeat
- dd uninstall
-
-
- -- Experiment by swapping: dialog id n <-> dialog n <-> dialog -n
- on DoUpdate()
- set s to ": "
- repeat with n from 1 to dd count dialogs
- set s to s & (dd get value of item 4 of dialog id n) & " "
- dd set contents of item 5 of dialog n to "dialog " & n & s
- end repeat
- end DoUpdate
-
- on MakeDialog()
- set n to dd count dialogs
- set x to 8 + (n mod 3) * 214
- set y to 44 + (n div 3) * 104
- return dd make dialog {bounds:[x, y, x + 196, y + 70], contents:[¬
- {class:push button, name:"Open", bounds:[6, 6, 46, 22], enabled:n < 6}, ¬
- {class:push button, name:"Close", bounds:[56, 6, 96, 22]}, ¬
- {class:push button, name:"Quit", bounds:[106, 6, 146, 22]}, ¬
- {class:text field, value:theVals's item (n + 1), bounds:[10, 30, 70, 42]}, ¬
- {class:static text, contents:"", bounds:[80, 30, 186, 70]} ¬
- ], name:"Dialog " & (ASCII character (n + 65)), style:document window}
- end MakeDialog