home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
fchooser.tcl
< prev
next >
Wrap
Text File
|
1996-08-12
|
1KB
|
47 lines
OtkRegister::gui
source [m4_path_name tcl libocl.tcl]
require "wmttool.tcl"
require "messagehdl.tcl"
proc SelectFile_okPressed {} {
# --------------------------------------
# an argument means writting into a file
# --------------------------------------
if { "$argv" == "" } {
puts "[.main.fc selectedSet]"
} else {
set fd [open "[lindex $argv 0]" "w"]
puts $fd "[.main.fc selectedSet]"
close $fd
}
# --------------------------------------------
# no delete necessary, exit (should) cleans up
# --------------------------------------------
exit
}
proc SelectFile_cancelPressed {} {
# --------------------------------------
# an argument means writting into a file
# --------------------------------------
if { "$argv" != "" } {
set fd [open "[lindex $argv 0]" "w"]
puts $fd ""
close $fd
}
exit
}
MainWindow new .main -closed exit
FileChooser new .main.fc \
-title "File Chooser" \
-directory [pwd] \
-okPressed { SelectFile_okPressed } \
-cancelPressed { SelectFile_cancelPressed } \
-helpPressed { wmtkwarning "No Help Available" } \
-selectionPolicy SINGLE \
-filter "*.*"
.main.fc popUp