Bob Weant wrote:
>
> I want to display a list of Button/Entry pairs to
> the user, such that the user can press the button
> and make a directory/file selection using the
> tk_getOpenfile routine. Once the dir/file is
> selected, I want the entry portion of the pair
> to display what the user selected.
>
> My button command is this:
>
> get_filedir BIFHOME
>
> proc get_filedir {w} {
>
> if {$filename != ""} {
> # Open the file ...
> set w $filename
> }
I can't give exact syntax without reading the book and testing, but you
need the "upvar" command to put "w" into the right scope so the proper
variable gets set.
Or perhaps you could get lazy and make your button command
set BIFHOME [get_filedir]
but I'd suggest reading up on upvar. It's probably something like
upvar #0 $w globvar
and then change the code in the procedure to be
set globvar $filename
--
...RickM...