Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add some buttons under listbox

Status
Not open for further replies.

stewang

Programmer
Aug 21, 2003
77
NZ
Hello all:
Would anyone give me idea that how to add some buttons under listbox. Thanks

Code:
set names {"Jones, Steve" "Jones, Matt" "Smith,Tony"
"Jefferies, Margaret" "Hall, Mark" "Cunningham, SallyJo"}

frame .listframe
listbox .listframe.namelist -listvariable names
scrollbar .listframe.namescroller -orient vertical

pack .listframe.namescroller -side right -fill y
pack .listframe.namelist -side left -fill both -expand yes
pack .listframe -fill both -expand yes

.listframe.namescroller configure -command ".listframe.namelist yview"

.listframe.namelist configure -yscrollcommand ".listframe.namescroller set"
 
Hello all:
Thanks for you pay attention to my question.
I known how to do already.

rgds
stewang

Code:
button .b -text "button" -bg white      -command newWindow
pack .b

proc newWindow {} {
 toplevel .t
 global lv
 set lv {"test" "test"}
 frame .t.listframe

 listbox .t.listframe.namelist -listvariable lv
 pack .t.listframe.namelist -side top
 pack .t.listframe

 frame .t.framebutton
 button .t.framebutton.b1 -text "test1" -bg white
 button .t.framebutton.b2 -text "test2" -bg lightblue
 button .t.framebutton.b3 -text "test3" -bg yellow

 pack .t.framebutton.b1 .t.framebutton.b2 .t.framebutton.b3 -side left

 pack .t.framebutton

}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top