| Deutsch English Français Italiano |
|
<vdtp30$2hfu$1@tota-refugium.de> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.tota-refugium.de!.POSTED!not-for-mail
From: nemethi <csaba.nemethi@t-online.de>
Newsgroups: comp.lang.tcl
Subject: Re: tablelist and unknow
Date: Sun, 6 Oct 2024 12:34:08 +0200
Message-ID: <vdtp30$2hfu$1@tota-refugium.de>
References: <vdrsom$r620$1@dont-email.me> <vdrt72$r620$2@dont-email.me>
<vds1gi$r620$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 6 Oct 2024 10:34:09 -0000 (UTC)
Injection-Info: tota-refugium.de;
logging-data="83454"; mail-complaints-to="abuse@news.tota-refugium.de"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Idh4o/B/BR1MLnws//oWO/w3kq8=
Content-Language: en-US
X-User-ID: eJwFwYEBwCAIA7CXFGiZ5wDa/09YAufmZBAMCGrd7A2dzoVyz8+P1LAYFG89W6OdT3QTcX4qLhFu
In-Reply-To: <vds1gi$r620$3@dont-email.me>
Bytes: 2748
Lines: 79
Am 05.10.24 um 20:45 schrieb Manfred Stelzhammer:
> 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
>>>
>>>
>>>
>>>
>>
>
1. As pointed out by daveb, it is dangerous to override the default
unknown proc. In addition, your unknown proc just prints its arguments,
which, of course, won't change the position of any column.
2. Your "workaround" that uses a proc moveCol:
proc moveCol {args} { ::tablelist::moveCol {*}$args }
works for me as expected. For example,
moveCol .tbl 2 1
does move column 2 before column 1.
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
}
--
Csaba Nemethi https://www.nemethi.de mailto:csaba.nemethi@t-online.de