diff options
author | dgp <dgp@users.sourceforge.net> | 2011-10-04 17:53:34 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-10-04 17:53:34 (GMT) |
commit | 7db583c448272a4b7be9ce0004b51f24b9be2121 (patch) | |
tree | 5b4bc1f3f667dfcaf144b9a436b6a296ed6ede81 /library | |
parent | 3ee702d38e706fd685edf15cf34bbf146d370e90 (diff) | |
download | tk-7db583c448272a4b7be9ce0004b51f24b9be2121.zip tk-7db583c448272a4b7be9ce0004b51f24b9be2121.tar.gz tk-7db583c448272a4b7be9ce0004b51f24b9be2121.tar.bz2 |
Contributed implementation patch for TIP 382.
Diffstat (limited to 'library')
-rw-r--r-- | library/tkfbox.tcl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl index 4ccf3d7..ffffb3e 100644 --- a/library/tkfbox.tcl +++ b/library/tkfbox.tcl @@ -983,6 +983,12 @@ proc ::tk::dialog::file::Config {dataName type argList} { lappend specs {-multiple "" "" "0"} } + # The "-nocomplain" option is only available for the "save" file dialog. + # + if {$type eq "save"} { + lappend specs {-nocomplain "" "" "0"} + } + # 2: default values depending on the type of the dialog # if {![info exists data(selectPath)]} { @@ -1859,7 +1865,7 @@ proc ::tk::dialog::file::Done {w {selectFilePath ""}} { set Priv(selectFile) $data(selectFile) set Priv(selectPath) $data(selectPath) - if {($data(type) eq "save") && [file exists $selectFilePath]} { + if {($data(type) eq "save") && !$data(-nocomplain) && [file exists $selectFilePath]} { set reply [tk_messageBox -icon warning -type yesno -parent $w \ -message [mc "File \"%1\$s\" already exists.\nDo you want\ to overwrite it?" $selectFilePath]] |