Hi
If I create a tablelist widget with "-movablecolumns 1" an I'll move a column it works ok.
But if I have a proc "unknown" I cann't move a column.
##
proc unknown {args} {puts "unknown : $args"}
##
If I move in the tablelistwidget a column I get:
% unknown : moveCol .tbl 2 1
But the position from the column don't change.
How can I solve the problem?
regards
Manfred
Hi
I found a workaround.
I create a proc moveCol.
##
proc moveCol {args} {::tablelist::moveCol {*}$args}
##
regards
Manfred
Am 05.10.24 um 19:24 schrieb Manfred Stelzhammer:
Hi
If I create a tablelist widget with "-movablecolumns 1" an I'll move a
column it works ok.
But if I have a proc "unknown" I cann't move a column.
##
proc unknown {args} {puts "unknown : $args"}
##
If I move in the tablelistwidget a column I get:
% unknown : moveCol .tbl 2 1
But the position from the column don't change.
How can I solve the problem?
regards
Manfred
Subject: tablelist and unknow
If I create a tablelist widget with "-movablecolumns 1" an I'll move a >column it works ok.
But if I have a proc "unknown" I cann't move a column.
##
proc unknown {args} {puts "unknown : $args"}
Sorry, I'm wrong, the workaround does'nt work.
regards
Manfred
Am 05.10.24 um 19:32 schrieb Manfred Stelzhammer:
Hi
I found a workaround.
I create a proc moveCol.
##
proc moveCol {args} {::tablelist::moveCol {*}$args}
##
regards
Manfred
Am 05.10.24 um 19:24 schrieb Manfred Stelzhammer:
Hi
If I create a tablelist widget with "-movablecolumns 1" an I'll move
a column it works ok.
But if I have a proc "unknown" I cann't move a column.
##
proc unknown {args} {puts "unknown : $args"}
##
If I move in the tablelistwidget a column I get:
% unknown : moveCol .tbl 2 1
But the position from the column don't change.
How can I solve the problem?
regards
Manfred
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
}
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
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 991 |
Nodes: | 10 (0 / 10) |
Uptime: | 119:15:51 |
Calls: | 12,958 |
Files: | 186,574 |
Messages: | 3,265,634 |