Re: tablelist: embed abutton in cells
- From: Bryan Oakley <oakley@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 28 Nov 2007 12:17:16 GMT
luckygiurato@xxxxxxxxx wrote:
Thank you for the reply.
Before writing my code, I take a look to your demo code and to the
documentation.
I copied part your code.
This is a frame of "my" code, where I insert data extracted from the
database in the tablelist:
for { set i 0 } { $i < $list_dimesion } { incr i } {
set item [ lindex $my_list $i ]
set item [ linsert $item 0 "" ]
$tbl insert end $item
$tbl cellconfigure $i,0 -window createButton
}
proc createButton {tbl row col w} {
button $w -text "edit $row" -command [ puts "ROW: $row" ]
}
Your problem is in the definition of the -command. You are saying "run the command 'puts "ROW: $row"', and use the result of that as the value for the -command option". That's almost certainly not what you intend.
Try this:
button $w -text "edit $row" -command [list puts "ROW: $row"]
.
- Follow-Ups:
- Re: tablelist: embed abutton in cells
- From: luckygiurato@xxxxxxxxx
- Re: tablelist: embed abutton in cells
- References:
- tablelist: embed abutton in cells
- From: luckygiurato@xxxxxxxxx
- Re: tablelist: embed abutton in cells
- From: Csaba Nemethi
- Re: tablelist: embed abutton in cells
- From: luckygiurato@xxxxxxxxx
- tablelist: embed abutton in cells
- Prev by Date: linux newbie starting tcl
- Next by Date: Re: linux newbie starting tcl
- Previous by thread: Re: tablelist: embed abutton in cells
- Next by thread: Re: tablelist: embed abutton in cells
- Index(es):