Re: tablelist: embed abutton in cells
- From: "luckygiurato@xxxxxxxxx" <luckygiurato@xxxxxxxxx>
- Date: Wed, 28 Nov 2007 06:06:47 -0800 (PST)
I tried both ways and I've the same result:
- No row number on the button text
- no output string
I tried even with command between "{}": same result too.
I'm sure that I write a wrong piece of code, but I don't understand
where is the mistake.
It seems that createButton procedure does't see its argoument, but
buttons are placed in the right place (first column of each line).
Thank you,
Luca
On 28 Nov, 13:17, Bryan Oakley <oak...@xxxxxxxxxxxxxxxxxxxx> wrote:
luckygiur...@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: Bryan Oakley
- 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
- Re: tablelist: embed abutton in cells
- From: Bryan Oakley
- tablelist: embed abutton in cells
- Prev by Date: Re: selecting nvarchar with Oratcl?
- Next by Date: Re: selecting nvarchar with Oratcl?
- Previous by thread: Re: tablelist: embed abutton in cells
- Next by thread: Re: tablelist: embed abutton in cells
- Index(es):