Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select all file and put all of them or one to anther frame

Status
Not open for further replies.

stewang

Programmer
Aug 21, 2003
77
NZ
Code:
Hello all:
Do anyone known how to pop up a dialog box for the user to select all and 
one file and put all the name of the items to listbox or frame or label.

At the movement, my coding just can pop up a dialog box for the user to select one file from folder.

menu .mbar

. configure -menu .mbar

menu .mbar.file -tearoff 0

.mbar add cascade -label "File" -underline 0    -menu .mbar.file

.mbar.file add command -label "Open" -underline 0    -command openFile

proc openFile {} {
 set filename [tk_getOpenFile]     
	set thefile [open $filename r]       
	set filecontent [read $thefile]       
	close $thefile       
}
 
use the "multiple" option:
set filelist [tk_getOpenFile -multiple 1]

Bob Rashkin
rrashkin@csc.com
 
Hi Bong:
Thanks for your reply.
After I add the option in my code, It doesn't change anything.
I run my code in Linux, Do you known any command for my question which it can use for a linux?

rgds
stewang

Code:
menu .mbar

. configure -menu .mbar

menu .mbar.file -tearoff 0

.mbar add cascade -label "File" -underline 0    -menu .mbar.file

.mbar.file add command -label "Open" -underline 0    -command openFile

proc openFile {} {
 set filename [tk_getOpenFile]     
    set thefile [open $filename r -multiple 1]       
    set filecontent [read $thefile]       
    close $thefile       
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top