One more check on valid display which is known to be in the startup
[xcircuit.git] / lib / tcl / boot_xcircuit.tcl
blobf422a7dfdd1d611f3f37de28f397998fdae52aa0
1 ## boot xcircuit within a starkit (replaces bin/xcircuit)
3 package provide app-xcircuit 3.6.36
5 # define the source code location
6 set XCIRCUIT_SRC_DIR [file join $::starkit::topdir lib app-xcircuit]
7 set env(XCIRCUIT_SRC_DIR) $XCIRCUIT_SRC_DIR
9 # define the library location (outside the starkit)
10 #set loclibdir [file join [file dirname $::starkit::topdir] xclib]
11 set loclibdir [file join $env(HOME) xclib]
12 #set XCIRCUIT_LIB_DIR [file join $loclibdir app-xcircuit]
13 set XCIRCUIT_LIB_DIR $loclibdir
14 set env(XCIRCUIT_LIB_DIR) $XCIRCUIT_LIB_DIR
16 # create the library if necessary (usually just the first time)
17 if {![file exists $loclibdir]} {
18 file mkdir $loclibdir
19 catch {unset libfiles}
20 # directories
21 lappend libfiles [file join $XCIRCUIT_SRC_DIR app-defaults]
22 lappend libfiles [file join $XCIRCUIT_SRC_DIR fonts]
23 lappend libfiles [file join $XCIRCUIT_SRC_DIR pixmaps]
24 # individual files
25 lappend libfiles [file join $XCIRCUIT_SRC_DIR xcircps2.pro]
26 foreach lf [glob -nocomplain -- [file join $XCIRCUIT_SRC_DIR *.lps]] {
27 lappend libfiles $lf
29 lappend libfiles [file join $XCIRCUIT_SRC_DIR xcstartup.tcl]
31 foreach lf $libfiles {
32 file copy $lf $loclibdir
34 unset libfiles
37 # start xcircuit thru tkcon w/o args
38 source [file join $XCIRCUIT_SRC_DIR tkcon.tcl]
39 tkcon main source [file join $XCIRCUIT_SRC_DIR console.tcl]
40 tkcon slave slave package require Tk
41 tkcon slave slave source [file join $XCIRCUIT_SRC_DIR xcircuit.tcl]
42 tkcon slave slave source [file join $XCIRCUIT_SRC_DIR xcstartup.tcl]