From 69db6bb6258ea9a1324dbb70b001d18606e41a35 Mon Sep 17 00:00:00 2001 From: Jeff Hobbs Date: Wed, 25 May 2005 20:23:53 +0000 Subject: [PATCH] * tkcon.tcl (InitMenus): add ActiveTcl Help menu item, if AT Help is found. --- ChangeLog | 5 +++++ tkcon.tcl | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/ChangeLog b/ChangeLog index b4728fc..a6f9da9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-05-25 Jeff Hobbs + + * tkcon.tcl (InitMenus): add ActiveTcl Help menu item, if AT Help + is found. + 2005-04-06 Jeff Hobbs * tkcon.tcl (ExpandXotcl): allow for xotcl method name expansion, diff --git a/tkcon.tcl b/tkcon.tcl index 2508d35..7a30f8f 100755 --- a/tkcon.tcl +++ b/tkcon.tcl @@ -1537,6 +1537,36 @@ proc ::tkcon::InitMenus {w title} { -command ::tkcon::About $m add command -label "Retrieve Latest Version" -underline 0 \ -command ::tkcon::Retrieve + if {![catch {package require ActiveTcl} ver]} { + set cmd "" + if {$tcl_platform(platform) == "windows"} { + package require registry + set ver [join [lrange [split $ver .] 0 3] .] + set key {HKEY_LOCAL_MACHINE\SOFTWARE\ActiveState\ActiveTcl} + if {![catch {registry get "$key\\$ver\\Help" ""} help] + && [file exists $help]} { + set cmd [list exec $::env(COMSPEC) /c start $help] + } + } elseif {$tcl_platform(os) == "Darwin"} { + set ver ActiveTcl-[join [lrange [split $ver .] 0 1] .] + set rsc "/Library/Frameworks/Tcl.framework/Resources" + set help "$rsc/English.lproj/$ver/index.html" + if {[file exists $help]} { + set cmd [list exec open $help] + } + } elseif {$tcl_platform(platform) == "unix"} { + set help [file dirname [info nameofexe]] + append help /../html/index.html + if {[file exists $help]} { + set cmd [list puts "Start $help"] + } + } + if {$cmd != ""} { + $m add separator + $m add command -label "ActiveTcl Help" -underline 10 \ + -command $cmd + } + } } } -- 2.23.0