Sujet : Re: tablelist and unknow
De : csaba.nemethi (at) *nospam* t-online.de (nemethi)
Groupes : comp.lang.tclDate : 06. Oct 2024, 16:51:08
Autres entêtes
Message-ID : <vdublc$2t41$1@tota-refugium.de>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
Am 06.10.24 um 14:32 schrieb
clt.to.davebr@dfgh.net:
From: nemethi <csaba.nemethi@t-online.de>
3. The above works, but it uses the ::tablelist::moveCol proc, which
belongs to the implementation of the tablelist widget, not to its
documented, public API. It is much better to use something like
>
proc moveCol {args} {
lassign $args tbl sourceCol targetCol
$tbl movecolumn $sourceCol $targetCol
}
>
I'm curious why you suggest using lassign $args... instead of putting the variables in the proc arguments list? Something like:
proc moveCol {tbl sourceCol targetCol} {$tbl movecolumn $sourceCol $targetCol}
Do error messages make more sense that way, or is it more efficient?
daveb
The only reason for using args was that the OP used this form with both procs unknown and moveCol.
-- Csaba Nemethi https://www.nemethi.de mailto:csaba.nemethi@t-online.de