|
Fileselectionbox
The fileselectionbox iwidget presents a file selector similar to that found in the Motif widget set. It consists of a file and directory list as well as a filter and selection entry widget. A child site also exists which may be positioned at several locations via an option. An extensive option set is provided which enables specification of initial directory, search commands, filter mask, no match string, and margins.
For further information, see the Fileselectionbox
manpage
Components: dirs files filter hull selection
|
wm title . "Fileselectionbox Example"
##
## Supporting procedure
## to print the selection
## of the dir/file
##
proc print {type} {
if {[string match "file" $type]} {
puts [file tail [.fsb get]]
} else {
puts [[.fsb component dirs] getcurselection]
}
return
}; # end proc print
##=========================================================
## Create a Fileselectionbox iwidget
##=========================================================
##
iwidgets::fileselectionbox .fsb \
-mask "*.html" \
-directory "../" \
-fileslabel "HTML Files" \
-dirslabel "Iwidgets HTML Dir" \
-selectdircommand {print dir} \
-selectfilecommand {print file}
pack .fsb \
-fill both \
-expand true
|
Download this sample code |
|