File: script_play

package info (click to toggle)
grass 6.0.2-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 40,044 kB
  • ctags: 31,303
  • sloc: ansic: 321,125; tcl: 25,676; sh: 11,176; cpp: 10,098; makefile: 5,025; fortran: 1,846; yacc: 493; lex: 462; perl: 133; sed: 1
file content (53 lines) | stat: -rwxr-xr-x 1,154 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!nviz -f
# This file handles script playing events by sourcing
# the selected script file.  Within the script file,
# "send" commands are used to actually send the events
# to nviz.  Note that by changing the variable ProcessName
# the events may be rerouted to a different nviz process.
# Also, this version of nviz is fairly insecure as it uses
# insecure sends.

catch {destroy .wait_ok}

global src_boot

source $src_boot/etc/nviz2.2/scripts/config.tcl

# Globals
# ProcessName now defined in config.tcl
#global ProcessName

# If the script option is used, then use that name for the script file,
# otherwise query the user for a script.
#Take first argument to be filename
if {$argc} {set NvizPlayScript $argv}

if {[catch {set NvizPlayScript}] == 0} then {
    global NvizPlayScript
	if {[file isfile $NvizPlayScript]} {
		set new_file "$NvizPlayScript"
	} else {
		tk_dialog .file_error "File Error" \
		"Script file $NvizPlayScript does not exist" \
		error 0 "Dismiss"
		exit
	}
} else {
    set new_file [create_file_browser .script_file_browser 1 1]
    if {$new_file == -1} then {
	exit
    }
}

wm withdraw .

source $new_file

exit