1 | #!/bin/sh |
---|
2 | # the next line restarts this script using wish found in the path\ |
---|
3 | exec wish "$0" "$@" |
---|
4 | # If this does not work, change the #!/usr/bin/wish line below |
---|
5 | # to reflect the actual wish location and delete all preceeding lines |
---|
6 | # |
---|
7 | # (delete here and above) |
---|
8 | #------------------------------------------------------------------------------ |
---|
9 | #------------------------------------------------------------------------------ |
---|
10 | # load the CIF dictionaries; this forces the creation of dictionary index files |
---|
11 | #------------------------------------------------------------------------------ |
---|
12 | #------------------------------------------------------------------------------ |
---|
13 | |
---|
14 | package require Tk |
---|
15 | # where is this file running from? |
---|
16 | set script [info script] |
---|
17 | # translate links -- go six levels deep |
---|
18 | foreach i {1 2 3 4 5 6} { |
---|
19 | if {[file type $script] == "link"} { |
---|
20 | set link [file readlink $script] |
---|
21 | if { [file pathtype $link] == "absolute" } { |
---|
22 | set script $link |
---|
23 | } { |
---|
24 | set script [file dirname $script]/$link |
---|
25 | } |
---|
26 | } else { |
---|
27 | break |
---|
28 | } |
---|
29 | } |
---|
30 | # fixup relative paths |
---|
31 | if {[file pathtype $script] == "relative"} { |
---|
32 | set script [file join [pwd] $script] |
---|
33 | } |
---|
34 | set scriptdir [file dirname $script ] |
---|
35 | |
---|
36 | source [file join $scriptdir browsecif.tcl] |
---|
37 | |
---|
38 | # define a list of dictionary files |
---|
39 | set dictfilelist [glob -nocomplain \ |
---|
40 | [file join [file dirname $scriptdir] data *.dic]] |
---|
41 | set CIF(dictfilelist) {} |
---|
42 | foreach f $dictfilelist { |
---|
43 | lappend ::CIF(dictfilelist) $f |
---|
44 | set ::CIF(dict_$f) 1 |
---|
45 | } |
---|
46 | # load the initial CIF dictionaries |
---|
47 | LoadDictIndices |
---|
48 | |
---|
49 | exit |
---|