GIF89a; EcchiShell v1.0
//usr/lib64/lib64/lib64/lib64/lib64/ 0} { incr data(fakeDir) -1 $data(w:dirlist) subwidget listbox select clear 0 end $data(w:dirlist) subwidget listbox activate -1 return } if {$data(flag)} { return } set data(flag) 1 set subdir [tixListboxGetCurrent [$data(w:dirlist) subwidget listbox]] if {$subdir == ""} { set subdir "." } tixFileSelectBox:SetFilter $w \ [tixFSNormalize [file join $data(i-directory) $subdir]] \ $data(i-pattern) set data(flag) 0 } proc tixFileSelectBox:InvokeDir {w} { upvar #0 $w data set theDir [$data(w:dirlist) subwidget listbox get active] tixFileSelectBox:SetDir $w \ [tixFSNormalize [file join $data(i-directory) $theDir]] $data(w:dirlist) subwidget listbox select clear 0 end tixFileSelectBox:SetFilter $w $data(i-directory) $data(i-pattern) tixFileSelectBox:InterpFilter $w [tixFSNativeNorm $data(filter)] tixFileSelectBox:LoadDir $w if {![tixEvent match ]} { incr data(fakeDir) 1 } } proc tixFileSelectBox:SelectFile {w} { upvar #0 $w data if {$data(flag)} { return } set data(flag) 1 # Reset the "Filter:" box to the current directory: # $data(w:dirlist) subwidget listbox select clear 0 end tixFileSelectBox:SetFilter $w $data(i-directory) $data(i-pattern) # Now select the file # set selected [tixListboxGetCurrent [$data(w:filelist) subwidget listbox]] if {$selected != ""} { # Make sure that the selection is not empty! # tixFileSelectBox:SetValue $w \ [tixFSNormalize [file join $data(i-directory) $selected]] tixSetSilent $data(w:selection) $data(-value) if {[llength $data(-browsecmd)]} { tixEvalCmdBinding $w $data(-browsecmd) "" $data(-value) } } set data(flag) 0 } proc tixFileSelectBox:InvokeFile {w} { upvar #0 $w data set selected [tixListboxGetCurrent [$data(w:filelist) subwidget listbox]] if {$selected != ""} { $w invoke } } # This is only called the first this fileBox is mapped -- load the directory # proc tixFileSelectBox:FirstMapped {w} { if {![winfo exists $w]} { return } upvar #0 $w data tixFileSelectBox:SetFilter $w $data(i-directory) $data(i-pattern) tixFileSelectBox:LoadDir $w $data(w:filter) align } #---------------------------------------------------------------------- # # # C O N V E N I E N C E R O U T I N E S # # #---------------------------------------------------------------------- # This is obsolete. Use the widget tixFileSelectDialog instead # # proc tixMkFileDialog {w args} { set option(-okcmd) "" set option(-helpcmd) "" tixHandleOptions option {-okcmd -helpcmd} $args toplevel $w wm minsize $w 10 10 tixStdDlgBtns $w.btns if {$option(-okcmd) != ""} { tixFileSelectBox $w.fsb \ -command "[list wm withdraw $w]; $option(-okcmd)" } else { tixFileSelectBox $w.fsb -command [list wm withdraw $w] } $w.btns button ok config -command [list $w.fsb invoke] $w.btns button apply config -command [list $w.fsb filter] -text Filter $w.btns button cancel config -command [list wm withdraw $w] if {$option(-helpcmd) == ""} { $w.btns button help config -state disabled } else { $w.btns button help config -command $option(-helpcmd) } wm protocol $w WM_DELETE_WINDOW [list wm withdraw $w] pack $w.btns -side bottom -fill both pack $w.fsb -fill both -expand yes return $w.fsb }