I'd like to use the mclistbox written by Bryan Oakley, but ran into trouble.
Simple code:
Quick desc:
The left mouse button click selects a single row in the $lst listbox.
The showRow proc extracts the value list out of the selected row upon such click.
The trouble is that I receive value of a single column and row (x and y) where the mouse pointer was aimed and button clicked.
I want the the whole list instead.
The above proc is also used along with the 'regular' listbox widget in another script and works fine as expected.
Anyone has experienced this behaviour?
Thanks in advance.
Simple code:
Code:
#!/usr/local/bin/wish
package require mclistbox
set lst [ mclistbox::mclistbox .listbox -width 130 ]
foreach {n l} [split "first First last Last org Organiz."] { $lst column add $n -label $l -width 20 }
pack $lst -side top
$lst insert end [list "Bryan" "Oakley" "ChannelPoint"]
$lst insert end [list "John" "Ousterhout" "Scriptics"]
bind $lst <ButtonRelease-1> { showRow %W }
proc showRow {w} {
set l [lindex [ $w get [ $w curselection ] ] 0 ]
puts $l
}
The left mouse button click selects a single row in the $lst listbox.
The showRow proc extracts the value list out of the selected row upon such click.
The trouble is that I receive value of a single column and row (x and y) where the mouse pointer was aimed and button clicked.
I want the the whole list instead.
The above proc is also used along with the 'regular' listbox widget in another script and works fine as expected.
Anyone has experienced this behaviour?
Thanks in advance.