Hi All
I have written a small code in tcl using pack options. I have some queries related to it.
Queries are
1. I was able to display the labelframe "Select Command " at distance of .5c from the frame , however the same thing, I am not able to do for the labelentry ?.
2. I wanted to have the buttons OK and CANCEL at the same level as labelframe and label entry and moreover the size of the buttons should be the same , I tried fill x , however it failed.
Can anybody suggest changes in this code
Thanking you in advance
Regards
Aman
proc testgui1 {w} {
toplevel $w.top
wm geometry $w.top 543x278+284+358; #update
wm transient $w.top .
wm title $w.top "MAIN WINDOW"
frame $w.top.mainframe -borderwidth 2 -relief groove -height 350 -width 495
pack $w.top.mainframe -expand true -pady .5c -padx .5c -ipadx 350 -ipady 495
set mainframe $w.top.mainframe
labelframe $mainframe.titframe -pady 2 -text " Select Command " -padx 2
pack $mainframe.titframe -side left -padx .5c -pady .5c -anchor nw -ipadx 5 -ipady 5
radiobutton $mainframe.titframe.rad0 -selectcolor white -text {Add } -relief flat -variable radio0 -value 0
radiobutton $mainframe.titframe.rad1 -selectcolor white -text {Remove } -relief flat -variable radio0 -value 1
pack $mainframe.titframe.rad0 -side top -anchor nw
pack $mainframe.titframe.rad1 -side top -anchor nw
LabelEntry $mainframe.lab77 -label { Major ID: } -takefocus 1 -text Edit -textvariable ""
LabelEntry $mainframe.cpd78 -disabledforeground #a3a3a3 -insertbackground black -label { Minor ID: } -takefocus 1 -text Edit -textvariable ""
LabelEntry $mainframe.lab79 -disabledforeground #a3a3a3 -insertbackground black -label {Command: } -takefocus 1 -text Edit -textvariable ""
button $mainframe.but80 -disabledforeground #a3a3a3 -pady 0 -text OK
button $mainframe.but81 -disabledforeground #a3a3a3 -pady 0 -text Cancel
pack $mainframe.lab77 -side top -pady 10 -anchor nw
pack $mainframe.cpd78 -side top -pady 10 -anchor nw
pack $mainframe.lab79 -side top -pady 10 -anchor nw
pack $mainframe.but80 -side top -padx 6 -pady 6 -ipadx 2 -ipady 2 -anchor ne
pack $mainframe.but81 -side top -padx 6 -pady 6 -ipadx 2 -ipady 2 -fill x -expand 1 -anchor ne
}
I have written a small code in tcl using pack options. I have some queries related to it.
Queries are
1. I was able to display the labelframe "Select Command " at distance of .5c from the frame , however the same thing, I am not able to do for the labelentry ?.
2. I wanted to have the buttons OK and CANCEL at the same level as labelframe and label entry and moreover the size of the buttons should be the same , I tried fill x , however it failed.
Can anybody suggest changes in this code
Thanking you in advance
Regards
Aman
proc testgui1 {w} {
toplevel $w.top
wm geometry $w.top 543x278+284+358; #update
wm transient $w.top .
wm title $w.top "MAIN WINDOW"
frame $w.top.mainframe -borderwidth 2 -relief groove -height 350 -width 495
pack $w.top.mainframe -expand true -pady .5c -padx .5c -ipadx 350 -ipady 495
set mainframe $w.top.mainframe
labelframe $mainframe.titframe -pady 2 -text " Select Command " -padx 2
pack $mainframe.titframe -side left -padx .5c -pady .5c -anchor nw -ipadx 5 -ipady 5
radiobutton $mainframe.titframe.rad0 -selectcolor white -text {Add } -relief flat -variable radio0 -value 0
radiobutton $mainframe.titframe.rad1 -selectcolor white -text {Remove } -relief flat -variable radio0 -value 1
pack $mainframe.titframe.rad0 -side top -anchor nw
pack $mainframe.titframe.rad1 -side top -anchor nw
LabelEntry $mainframe.lab77 -label { Major ID: } -takefocus 1 -text Edit -textvariable ""
LabelEntry $mainframe.cpd78 -disabledforeground #a3a3a3 -insertbackground black -label { Minor ID: } -takefocus 1 -text Edit -textvariable ""
LabelEntry $mainframe.lab79 -disabledforeground #a3a3a3 -insertbackground black -label {Command: } -takefocus 1 -text Edit -textvariable ""
button $mainframe.but80 -disabledforeground #a3a3a3 -pady 0 -text OK
button $mainframe.but81 -disabledforeground #a3a3a3 -pady 0 -text Cancel
pack $mainframe.lab77 -side top -pady 10 -anchor nw
pack $mainframe.cpd78 -side top -pady 10 -anchor nw
pack $mainframe.lab79 -side top -pady 10 -anchor nw
pack $mainframe.but80 -side top -padx 6 -pady 6 -ipadx 2 -ipady 2 -anchor ne
pack $mainframe.but81 -side top -padx 6 -pady 6 -ipadx 2 -ipady 2 -fill x -expand 1 -anchor ne
}