title: TCL:How to list all files in a directory and create a radiobutton for each item
body: <p>I am writing a piece of code to list all items in a directory and then create a radiobutton for each of these items.
  I am not able to achieve this with the below code:</p>
  
  <pre><code>proc check_lib_name {} {
      global ENTRYfilename5 ENTRYfilename
      cd $ENTRYfilename/$ENTRYfilename5
      set dirnames [glob -type d *]
      foreach f $dirnames {
          radiobutton .top.d.$dirnames -text $dirnames -variable list_libs
          grid .top.d.$dirnames -sticky nsew
          puts $ENTRYfilename5
      }
  }
  </code></pre>
  
  <p>Only 1 radiobutton is getting created with all names appended into it.
  Also, I am a bit confused how to give a different column and row values to each radiobutton.</p>