When this is done, the first Tcl-script can be built:
# create new window toplevel .fileselect # entry-frame entry .fileselect.entry pack .fileselect.entry -side top -fill x # filelist-frame frame .fileselect.files listbox .fileselect.files.list pack .fileselect.files.list -side left -fill both -expand true scrollbar .fileselect.files.scrolly pack .fileselect.files.scrolly -side right -fill y pack .fileselect.files -side top -fill both -expand true # button-frame frame .fileselect.buttons button .fileselect.buttons.ok -text OK pack .fileselect.buttons.ok -side left -fill x -expand true button .fileselect.buttons.cancel -text CANCEL pack .fileselect.buttons.cancel -side right -fill x -expand true pack .fileselect.buttons -side top -fill x
The -fill
and -expand
parameters are used to let the widgets
fill the available space and to let them grow when the window is enlarged
(compare this to what happens when these parameters are left out).