Continuing to track down the issue with a crash on startup on
[xcircuit.git] / examples / xc_remote.sh
blob8c21f8049d735f84d01df5583487eaa6c667d8ac
1 #!/usr/local/bin/wish8.5
3 # Usage: xc_remote <filename>
5 # This script attempts to communicate with an existing xcircuit
6 # application. If none exists, it starts a new xcircuit process.
7 # If one exists, then it forces xcircuit to create a new window,
8 # and the file <filename> is loaded into it as a new page.
10 exec xhost -
11 foreach host [lrange [split [exec xhost] \n] 1 end] {
12 exec xhost -$host
14 set appname "tkcon.tcl #2"
15 if {[catch {send $appname xcircuit::forkwindow}]} {
16 exec xcircuit [lindex $argv 0] &
17 } else {
18 send $appname {config focus [lindex [config windownames] 0]}
19 set npages [send $appname page links total]
20 incr npages
21 send $appname page $npages goto -force
22 send $appname page load [lindex $argv 0]
24 exit