Debian Codegraph @

tclpkg/tcldot/examples/xvdisp

raw
1 #!/bin/sh
2 # next line is a comment in tcl \
3 exec tclsh "$0" ${1+"$@"}
4
5 package require Tcldot
6
7 # xvdisp - display a .gv file using xv - John Ellson <[email protected]>
8 #
9 # Usage: xvdisp <file.gv>
10 #
11
12 if {[llength $argv] == 0} {
13 puts "No .gv file specified. Assuming demo."
14 set argv "data/poly.gv"
15 }
16 if {[llength $argv] > 1} {puts "Too many args."; exit}
17 if {[catch {open $argv r} f]} {puts "unable to open .gv file"; exit}
18 set g [dotread $f]
19 close $f
20
21 $g layout
22
23 puts [$g queryattribute bb]
24
25 if {[catch {open "| xv -" w} f]} {puts "unable to open output pipe to xv"; exit}
26 $g write $f gif
27 close $f