TK-Fileload from last Directory
Posted: Thu Sep 23, 2004 11:04 am
A little modification in newlisp-tk.tcl allows the Fileopen-Dialog to open in the lastLoadedFile-directory by adding a '-initialdir $lastLoadedFile'
Maybe a matter of personal taste, but I find it annoying that it always go back to c:\newlisp.
Code: Select all
proc LoadFile {} {
global statusText FileTypeList lastLoadedFile remoteFlag
if {$remoteFlag == 0 } {
set spec [tk_getOpenFile -title "Load a newLISP source file" \
-filetypes $FileTypeList -initialdir $lastLoadedFile]
} else { FileDialog "load" "Load a newLISP source file" . ; return }
if { $spec == "" } { return }
set cd [file dirname $spec]
NewlispEvaluate "(silent (load \"$spec\") (change-dir \"$cd\"))"
set lastLoadedFile $spec
set statusText "Loaded file $spec"
}