splinter98
Programmer
I want to be able to get a listbox select one of the options right-click it a menu pops up and then there is listed a load of commands in which the option selected is included as part of some of the labels i have this code:
the menu works but all i get is a blank item. any suggestions wld be helpful
Code:
frame .f
listbox .lb -selectmode multiple -height 4
scrollbar .sb -command [list .lb yview]
.lb configure -yscrollcommand [list .sb set]
.lb insert end sample
pack .lb .sb -in .f -side left -expand 1 -fill both
set m [menu .popupMenu]
set sel [.lb curselection]
$m add command -label $sel -command bell
bind .lb <3> {tk_popup .popupMenu %X %Y}
grid .f
the menu works but all i get is a blank item. any suggestions wld be helpful