home *** CD-ROM | disk | FTP | other *** search
- # wtest
- # This is a demonstration file giving simple examples of the w commands
-
-
- #This loads the standard font and colour names.
-
- source {<tcl$Dir>.!Choices}
-
-
- #This initialises the w system. "wtest" will be used for the name of the program
- # in the Tasks display window
- #The sprite file "testsprites" is loaded into a user sprite area from the
- # application directory.
-
- w_init wtest testsprite
-
-
- # Load a library to report errors
-
- source {<tcl$Dir>.library.debug}
-
-
- # load tests for w_text w_draw w_box
-
- source {<wtest$Dir>.texttest}
- source {<wtest$Dir>.drawtest}
- source {<wtest$Dir>.dboxtest}
-
- # Make a dialog box for the info entry on the iconbar menu
- # It is called "progInfo"
- # Its title is "About this program"
- # It has a vertical list of four info boxes displaying text.
-
- w_box progInfo create "About this program"\
- { vlist {info Name wtest}
- {info Purpose "w example"}
- {info Author C.T.Stretch}
- {info Version 0.01}
- }
-
-
- #Put the "!wtest" icon on the iconbar
- #Give it a menu, and a procedure to run if it clicked on.
- #The menu has title "wtest".
- #It has two entries, one opens the progInfo dialog box created above,
- #The other runs the script "exit" if it is clicked on.
- #If the icon is clicked the procedure clickproc will be called
- #with a string representing the button used
-
- w_bar -menu { wtest {Info -dbox progInfo}
- {Quit -click exit}
- }\
- -click {clickproc %b}
-
-
- #This procedure is called when the iconbar icon is clicked on.
- # button will be set to "s" if select was used and "a" if alter was used.
- # "S" or "C" will be added if the shift or control keys were held down.
-
- proc clickproc {button}\
- { if {$button=="s"} {textopen}
- if {$button=="a"} {drawopen}
- if {$button=="sS"} {boxopen}
- }
-
-
-
-
-