Tk Source Code

Artifact [3124927b]
Login

Artifact 3124927b4fe56bb5a3b630afabe1fb23a28ca969:

Attachment "fbox.patch" to ticket [411640ff] added by hobbs 2001-03-30 12:59:10.
Index: library/tkfbox.tcl
===================================================================
RCS file: /cvsroot/tktoolkit/tk/library/tkfbox.tcl,v
retrieving revision 1.24
diff -b -c -r1.24 tkfbox.tcl
*** library/tkfbox.tcl	2000/10/19 01:05:01	1.24
--- library/tkfbox.tcl	2001/03/30 05:57:04
***************
*** 1502,1510 ****
      
      set text [$data(ent) get]
      if {$data(-multiple)} {
  	set data(selectFile) ""
! 	foreach fname $text {
! 	    ::tk::dialog::file::VerifyFileName $w $fname
  	}
      } else {
  	::tk::dialog::file::VerifyFileName $w $text
--- 1502,1515 ----
  
      set text [$data(ent) get]
      if {$data(-multiple)} {
+ 	# For the multiple case we have to be careful to get the file
+ 	# names as a true list, watching out for a single file with a
+ 	# space in the name.  Thus we query the IconList directly.
+ 
  	set data(selectFile) ""
! 	foreach item [tkIconList_Curselection $data(icons)] {
! 	    ::tk::dialog::file::VerifyFileName $w \
! 		    [tkIconList_Get $data(icons) $item]
  	}
      } else {
  	::tk::dialog::file::VerifyFileName $w $text
***************
*** 1622,1628 ****
  	lappend text [tkIconList_Get $data(icons) $item]
      }
  
!     if {[llength $text] && !$data(-multiple)} {
  	set text [lindex $text 0]
  	set file [::tk::dialog::file::JoinFile $data(selectPath) $text]
  	if {[file isdirectory $file]} {
--- 1627,1634 ----
  	lappend text [tkIconList_Get $data(icons) $item]
      }
  
!     if {([llength $text] && !$data(-multiple)) || \
! 	    ($data(-multiple) && ([llength $text] == 1))} {
  	set text [lindex $text 0]
  	set file [::tk::dialog::file::JoinFile $data(selectPath) $text]
  	if {[file isdirectory $file]} {