newLISP Fan Club

Forum => newLISP in the real world => Topic started by: HPW on September 23, 2004, 04:04:14 AM

Title: TK-Fileload from last Directory
Post by: HPW on September 23, 2004, 04:04:14 AM
A little modification in newlisp-tk.tcl allows the Fileopen-Dialog to open in the lastLoadedFile-directory by adding a '-initialdir $lastLoadedFile'



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"
}


Maybe a matter of personal taste, but I find it annoying that it always go back to c:newlisp.
Title:
Post by: Lutz on September 23, 2004, 05:43:40 AM
Thanks, I will put this in a next version



Lutz
Title:
Post by: HPW on October 06, 2004, 02:15:03 AM
8.2.1 still on tk 1.17 without -initialdir $lastLoadedFile!

;-)
Title:
Post by: Lutz on October 06, 2004, 05:36:54 AM
just got it in now for 1.18



Lutz