在ubuntu下安装sourcenavigator,可通过sudo apt-get install sourcenav,也可以通过下载sourcenav-6.0.tar.gz来进行安装。
但是在终端中通过"$snavigator"指令启动sourcenavigator时,出现如下问题:
1 Can't find a usable tk.tcl in the following directories: 2 /usr/local/share/tk8.3 3 4 /usr/local/share/tk8.3/tk.tcl: no event type or button # or keysym 5 no event type or button # or keysym 6 while executing 7 "bind Listbox <MouseWheel> { 8 %W yview scroll [expr {- (%D / 120) * 4}] units 9 }" 10 (file "/usr/local/share/tk8.3/listbox.tcl" line 182) 11 invoked from within 12 "source [file join $tk_library listbox.tcl]" 13 invoked from within 14 "if {[string compare $tcl_platform(platform) "macintosh"] && \ 15 [string compare {} $tk_library]} { 16 source [file join $tk_library button.tcl] 17 so..." 18 (file "/usr/local/share/tk8.3/tk.tcl" line 308) 19 invoked from within 20 "source /usr/local/share/tk8.3/tk.tcl" 21 ("uplevel" body line 1) 22 invoked from within 23 "uplevel \#0 [list source $file]" 24 25 26 This probably means that tk wasn't installed properly.
然后google,看了看,知道解决方法了。
注意上面的第10行:file “/usr/local/share/tk8.3/listbox.tcl” line 182
于是:
$sudo gedit /usr/local/share/tk8.3/listbox.tcl
注释掉182~184三行。
然后:
$snavigator
又囧了,提示如下:
1 2 Can't find a usable tk.tcl in the following directories: 3 /usr/local/share/tk8.3 4 5 /usr/local/share/tk8.3/tk.tcl: no event type or button # or keysym 6 no event type or button # or keysym 7 while executing 8 "bind Text <MouseWheel> { 9 %W yview scroll [expr {- (%D / 120) * 4}] units 10 }" 11 (file "/usr/local/share/tk8.3/text.tcl" line 457) 12 invoked from within 13 "source [file join $tk_library text.tcl]" 14 invoked from within 15 "if {[string compare $tcl_platform(platform) "macintosh"] && \ 16 [string compare {} $tk_library]} { 17 source [file join $tk_library button.tcl] 18 so..." 19 (file "/usr/local/share/tk8.3/tk.tcl" line 308) 20 invoked from within 21 "source /usr/local/share/tk8.3/tk.tcl" 22 ("uplevel" body line 1) 23 invoked from within 24 "uplevel \#0 [list source $file]" 25 26 27 This probably means that tk wasn't installed properly.
照着葫芦画瓢,注意第11行:file “/usr/local/share/tk8.3/text.tcl” line 457
好吧:
$sudo gedit /usr/local/share/tk8.3/text.tcl
注释掉457~459行。
然后再:
$snavigator
正常了。