- Timestamp:
- Dec 4, 2009 5:11:22 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsascmds.tcl
- Property rcs:date changed from 2003/11/05 22:16:55 to 2003/11/13 17:21:17
- Property rcs:lines changed from +10 -4 to +75 -60
- Property rcs:rev changed from 1.52 to 1.53
r742 r749 227 227 228 228 if {[string compare $data(-default) ""]} { 229 bind $w <Return> [list tkButtonInvoke $w.[string tolower $data(-default)]]229 bind $w <Return> [list $w.[string tolower $data(-default)] invoke] 230 230 } 231 231 … … 858 858 proc urlOpen {url} { 859 859 global env tcl_platform 860 switch $tcl_platform(platform) { 861 "unix" { 862 if {![info exists env(BROWSER)]} { 863 set progs [auto_execok netscape] 864 if {[llength $progs]} { 865 set env(BROWSER) [list $progs] 866 } 867 } 868 if {![info exists env(BROWSER)]} { 869 set progs [auto_execok mozilla] 870 if {[llength $progs]} { 871 set env(BROWSER) [list $progs] 872 } 873 } 874 if {[info exists env(BROWSER)]} { 875 if {[catch {exec $env(BROWSER) -remote openURL($url)}]} { 860 if {$tcl_platform(os) == "Darwin"} { 861 # if this is an external URL or does not contain an anchor, take the 862 # easy approach 863 if {[string range $url 0 4] == "http:" || \ 864 [string first "#" $url] == -1} { 865 if {![catch {exec open $url}]} { 866 return 867 } 868 } 869 # so sorry, have to use Internet Explorer 870 set url [file nativename $url]; # replace ~/ if present 871 if {[file pathtype $url] == "relative"} { 872 set url [file join [pwd] $url] 873 } 874 exec osascript -e "tell application \"Internet Explorer\"\rGetURL \"file://$url\"\rend tell" 875 } elseif {$tcl_platform(platform) == "unix"} { 876 set browserlist {} 877 if {[info exists env(BROWSER)]} { 878 set browserlist $env(BROWSER) 879 } 880 lappend browserlist netscape mozilla 881 foreach p $browserlist { 882 set progs [auto_execok $p] 883 if {[llength $progs]} { 884 if {[catch {exec $progs -remote openURL($url)}]} { 876 885 # perhaps browser doesn't understand -remote flag 877 886 if {[catch {exec $env(BROWSER) $url &} emsg]} { … … 879 888 } 880 889 } 881 } else {882 MyMessageBox -parent . -title "No Browser" \883 -message "Could not find a browser. Netscape is not in path. Define environment variable BROWSER to be full path name of browser." \884 -icon warning885 }886 } 887 "windows"{888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 }914 "macintosh" { 915 916 917 918 919 920 890 return 891 } 892 } 893 MyMessageBox -parent . -title "No Browser" \ 894 -message "Could not find a browser. Netscape & Mozilla not found. Define environment variable BROWSER to be full path name of browser." \ 895 -icon warning 896 } elseif {$tcl_platform(platform) == "windows"} { 897 package require registry 898 # Look for the application under 899 # HKEY_CLASSES_ROOT 900 set root HKEY_CLASSES_ROOT 901 902 # Get the application key for HTML files 903 set appKey [registry get $root\\.html ""] 904 905 # Get the command for opening HTML files 906 set appCmd [registry get \ 907 $root\\$appKey\\shell\\open\\command ""] 908 909 # Substitute the HTML filename into the command for %1 910 # or stick it on the end 911 if {[string first %1 $appCmd] != -1} { 912 regsub %1 $appCmd $url appCmd 913 } else { 914 append appCmd " " $url 915 } 916 917 # Double up the backslashes for eval (below) 918 regsub -all {\\} $appCmd {\\\\} appCmd 919 920 # Invoke the command 921 eval exec $appCmd & 922 } elseif {$tcl_platform(platform) == "macintosh"} { 923 # preOSX -- this is not used 924 if {0 == [info exists env(BROWSER)]} { 925 set env(BROWSER) "Browse the Internet" 926 } 927 if {[catch { 928 AppleScript execute\ 929 "tell application \"$env(BROWSER)\" 921 930 open url \"$url\" 922 931 end tell 923 932 "} emsg] 924 } then { 925 error "Error displaying $url in browser\n$emsg" 926 } 927 } 933 } then { 934 error "Error displaying $url in browser\n$emsg" 935 } 928 936 } 929 937 } 930 938 931 939 proc NetHelp {file anchor localloc netloc} { 940 # use the file on-line, if it exists 932 941 if {[file exists [file join $localloc $file]]} { 933 942 set url "[file join $localloc $file]" … … 1773 1782 -class SmallFont] \ 1774 1783 -side top -fill both -expand yes -pady 5 1784 } elseif {$mode != "new"} { 1785 # for initial read, don't access archived files 1786 pack [frame $expgui(FileInfoBox) -bd 4 -relief groove \ 1787 -class SmallFont] \ 1788 -side top -fill both -expand yes -pady 5 1789 set mode "old" 1775 1790 } 1776 1791 pack [button $frmC.b -text Read \ … … 2169 2184 close $fp 2170 2185 update 2171 regexp {GNLS RUN on (.*) +Total.*run +([0-9]+) } \2186 regexp {GNLS RUN on (.*) +Total.*run *([0-9]+) } \ 2172 2187 $testline a last cycles 2173 2188 pack [label $expgui(FileInfoBox).2 -justify left \
Note: See TracChangeset
for help on using the changeset viewer.