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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mclistbox

Status
Not open for further replies.

zby

Programmer
Oct 31, 2003
22
0
0
CZ
I'd like to use the mclistbox written by Bryan Oakley, but ran into trouble.
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
	}
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top