Menu

#5 Tcl stack in tixDirList when switch file system

open
nobody
None
5
2008-11-22
2008-11-22
No

A testcase is simple:
tixDirList .dirlist
pack .dirlist
Need to create a directory on another file system and create a several subdirectories there. Then create a link to that tree from current directory and start executing this script in current directory. Double click on the link, then double click on a subdirectory in that file system. You will get a Tcl stack like I got:
===================
Error:
Entry "/home/eugene/tmp/bbb/rd/11" not found
Entry "/home/eugene/tmp/bbb/rd/11" not found
while executing
"$data(w:hlist) entryconfig $vpath -image [tix getimage act_fold]"
(procedure "tixDirList:ListSubDirs" line 4)
invoked from within
"tixDirList:ListSubDirs $w $npath $vpath"
(procedure "tixDirList:LoadDir" line 14)
invoked from within
"tixDirList:LoadDir $w [tixFSNativeNorm $value] $vpath"
(procedure "tixDirList:Command" line 8)
invoked from within
"tixDirList:Command .dirlist /home/eugene/tmp/bbb/rd/11"
("uplevel" body line 1)
invoked from within
"uplevel \#0 $cmd $args"
====================
The trouble happened because while redrawing the tree in the widget, some functions use old directory name, another use new, translated name from tixFSNativeNorm. The directory in another file system has two names: link from current file system, and real name on native file system.
In my case rd is a link from /home/eugene/tmp/bbb to another file system.

I modified a couple of lines in DirList.tcl and it helps. Not sure if it best way, but here it is:
=== DirList.tcl ===
126,127c126,128
< tixDirList:LoadDir $w [tixFSNativeNorm $value] $vpath
< tixDirList:HighLight $w $vpath
---
> set npath [tixFSNativeNorm $value]
> tixDirList:LoadDir $w $npath $vpath
> tixDirList:HighLight $w $npath
194c195
< $data(w:hlist) entryconfig $vpath -image [tix getimage act_fold]
---
> $data(w:hlist) entryconfig $npath -image [tix getimage act_fold]

Discussion


Log in to post a comment.