I am new to Tcl/TK and am trying to build a GUI with two frames The first frame is a text frame to view files, and a second frame of config options. They will both be visible all the time with one on the right, and the other on the left. I can build the pieces separately, but am having trouble putting them together. For instance, how do you tie a label and an entry to the same line. I tried using various pack options with no luck. Do I need to imbed frames within a frame? For example, I have a list box and a scrollbar in the example below. I cannot get them to be tied to each other. Should I define a separate frame for each group of widgets I want to tie together?
#!/bin/sh
#exec wish "$0" "$@"
menu .menubar -type menubar
.menubar add cascade -label File -menu .menubar.file -underline 0
#file menu
menu .menubar.file -tearoff 0
.menubar.file add command -label "New" -underline 0 -command { new }
.menubar.file add command -label "Open..." -underline 0 -command { file_get }
.menubar.file add command -label "Save" -underline 0 -command { save }
.menubar.file add command -label "Save As..." -underline 5 -command { file_save_as }
.menubar.file add separator
.menubar.file add command -label Exit -underline 1 -command { exit }
#end file menu
. configure -menu .menubar
#
# Define a frame widget to hold config parameters
# Note: possibly call this from a "configure button"
#
frame .config
label .config.repLabel -text "Report:"
tk_optionMenu .config.repNames repOption "History Report" "Snapshot Report" "Operator Report" pack .config.repLabel .config.repNames
label .config.timeLabel -text "Start Time:"
entry .config.strtDateTime -width 40 -textvariable repStrtTime
entry .config.stopDateTime -width 40 -textvariable repStopTime
entry .config.histDateTime -width 40 -textvariable repHistTime
pack .config.timeLabel .config.strtDateTime
button .config.button2 -text "Generate Report" -command { gen_report $repOption $repStrtTime $repStopTime $repHistTime }
scrollbar .config.scroll -command ".config.list yview"
listbox .config.list -yscroll ".config.scroll set" -setgrid 1 -height 10
pack .config.timeLabel .config.strtDateTime .config.stopDateTime .config.histDateTime -side top -anchor w -pady 5 -padx 10
pack .config.button2 -side bottom -expand yes
pack .config.scroll -side right -fill y
pack .config.list
pack .config -fill x
.config.list insert 0 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z AA BB CC DD EE FF GG HH
set filename "Untitled"
frame .text
text .text.t -wrap none -yscrollcommand ".text.v_scroll set" -xscrollcommand ".text.h_scroll set"
scrollbar .text.v_scroll -command ".text.t yview"
scrollbar .text.h_scroll -command ".text.t xview" -orient horizontal
pack .text.v_scroll -side right -fill y
pack .text.h_scroll -side bottom -fill x
pack .text.t -side left -fill both -expand 1
pack .text -fill both -expand 1
#
# Procedure definitions
#
#!/bin/sh
#exec wish "$0" "$@"
menu .menubar -type menubar
.menubar add cascade -label File -menu .menubar.file -underline 0
#file menu
menu .menubar.file -tearoff 0
.menubar.file add command -label "New" -underline 0 -command { new }
.menubar.file add command -label "Open..." -underline 0 -command { file_get }
.menubar.file add command -label "Save" -underline 0 -command { save }
.menubar.file add command -label "Save As..." -underline 5 -command { file_save_as }
.menubar.file add separator
.menubar.file add command -label Exit -underline 1 -command { exit }
#end file menu
. configure -menu .menubar
#
# Define a frame widget to hold config parameters
# Note: possibly call this from a "configure button"
#
frame .config
label .config.repLabel -text "Report:"
tk_optionMenu .config.repNames repOption "History Report" "Snapshot Report" "Operator Report" pack .config.repLabel .config.repNames
label .config.timeLabel -text "Start Time:"
entry .config.strtDateTime -width 40 -textvariable repStrtTime
entry .config.stopDateTime -width 40 -textvariable repStopTime
entry .config.histDateTime -width 40 -textvariable repHistTime
pack .config.timeLabel .config.strtDateTime
button .config.button2 -text "Generate Report" -command { gen_report $repOption $repStrtTime $repStopTime $repHistTime }
scrollbar .config.scroll -command ".config.list yview"
listbox .config.list -yscroll ".config.scroll set" -setgrid 1 -height 10
pack .config.timeLabel .config.strtDateTime .config.stopDateTime .config.histDateTime -side top -anchor w -pady 5 -padx 10
pack .config.button2 -side bottom -expand yes
pack .config.scroll -side right -fill y
pack .config.list
pack .config -fill x
.config.list insert 0 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z AA BB CC DD EE FF GG HH
set filename "Untitled"
frame .text
text .text.t -wrap none -yscrollcommand ".text.v_scroll set" -xscrollcommand ".text.h_scroll set"
scrollbar .text.v_scroll -command ".text.t yview"
scrollbar .text.h_scroll -command ".text.t xview" -orient horizontal
pack .text.v_scroll -side right -fill y
pack .text.h_scroll -side bottom -fill x
pack .text.t -side left -fill both -expand 1
pack .text -fill both -expand 1
#
# Procedure definitions
#