home *** CD-ROM | disk | FTP | other *** search
- 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
-