Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

You will have a long and boring life.


comp / comp.lang.tcl / tablelist and unknow

SubjectAuthor
* tablelist and unknowManfred Stelzhammer
+* Re: tablelist and unknowManfred Stelzhammer
|`* Re: tablelist and unknowManfred Stelzhammer
| `* Re: tablelist and unknownemethi
|  `* Re: tablelist and unknowclt.to.davebr
|   `- Re: tablelist and unknownemethi
`- tablelist and unknowclt.to.davebr

1
Subject: tablelist and unknow
From: Manfred Stelzhammer
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sat, 5 Oct 2024 17:24 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: manfred@antispam.at (Manfred Stelzhammer)
Newsgroups: comp.lang.tcl
Subject: tablelist and unknow
Date: Sat, 5 Oct 2024 19:24:38 +0200
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <vdrsom$r620$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 05 Oct 2024 19:24:39 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="92b01aafe25c9cad6d1122f66f3d90ea";
logging-data="890944"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18nMrI52HmBwW90wrMbXiQIkvjhRUexrfU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:+b6xeIfHMHZZ7mmbzGyCOTdCQfo=
Content-Language: en-US
View all headers

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: Re: tablelist and unknow
From: Manfred Stelzhammer
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sat, 5 Oct 2024 17:32 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: manfred@antispam.at (Manfred Stelzhammer)
Newsgroups: comp.lang.tcl
Subject: Re: tablelist and unknow
Date: Sat, 5 Oct 2024 19:32:18 +0200
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <vdrt72$r620$2@dont-email.me>
References: <vdrsom$r620$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 05 Oct 2024 19:32:19 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="92b01aafe25c9cad6d1122f66f3d90ea";
logging-data="890944"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19+ZI74tEXFzgWrCd+mOKQQm3RyyTql9TU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:cTqm4ND3pQagJVJM7NTIxHpnEto=
Content-Language: en-US
In-Reply-To: <vdrsom$r620$1@dont-email.me>
View all headers

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: Re: tablelist and unknow
From: Manfred Stelzhammer
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sat, 5 Oct 2024 18:45 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: manfred@antispam.at (Manfred Stelzhammer)
Newsgroups: comp.lang.tcl
Subject: Re: tablelist and unknow
Date: Sat, 5 Oct 2024 20:45:38 +0200
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <vds1gi$r620$3@dont-email.me>
References: <vdrsom$r620$1@dont-email.me> <vdrt72$r620$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 05 Oct 2024 20:45:38 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="92b01aafe25c9cad6d1122f66f3d90ea";
logging-data="890944"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX187lzJlLtS6TJPG24fugx5nQsDrSysMKDM="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:gsCovRI1EZB92RofGPGWX4dgLeg=
In-Reply-To: <vdrt72$r620$2@dont-email.me>
Content-Language: en-US
View all headers

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
>>
>>
>>
>>
>

Subject: tablelist and unknow
From: clt.to.davebr@dfgh.net
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sun, 6 Oct 2024 02:54 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: clt.to.davebr@dfgh.net
Newsgroups: comp.lang.tcl
Subject: tablelist and unknow
Date: Sun, 06 Oct 24 02:54:54 GMT
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <87417281832941001@llp>
References: <vdrsom$r620$1@dont-email.me>
Injection-Date: Sun, 06 Oct 2024 04:57:59 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="4b73736714c8bfe549dcbf04e4915f43";
logging-data="1160288"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19EG+7FA4Q9jc98MnKVd1hQ"
Cancel-Lock: sha1:tJ1aqcVrvqOdqgYrQa+3CPU/B2A=
In-Reply-To: <vdrsom$r620$1@dont-email.me>
View all headers

>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"}

Your unknown command might be masking an auto-loaded command or package.

See the Tcl unknown manpage for more information.

daveb

Subject: Re: tablelist and unknow
From: nemethi
Newsgroups: comp.lang.tcl
Date: Sun, 6 Oct 2024 10:34 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.tota-refugium.de!.POSTED!not-for-mail
From: csaba.nemethi@t-online.de (nemethi)
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>
View all headers

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

Subject: Re: tablelist and unknow
From: clt.to.davebr@dfgh.net
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sun, 6 Oct 2024 12:32 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: clt.to.davebr@dfgh.net
Newsgroups: comp.lang.tcl
Subject: Re: tablelist and unknow
Date: Sun, 06 Oct 24 12:32:21 GMT
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <21517282179411001@llp>
References: <vdrsom$r620$1@dont-email.me> <vdrt72$r620$2@dont-email.me> <vds1gi$r620$3@dont-email.me> <vdtp30$2hfu$1@tota-refugium.de>
Injection-Date: Sun, 06 Oct 2024 14:35:26 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="4b73736714c8bfe549dcbf04e4915f43";
logging-data="1309666"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NzQetUkoqHSR+ZhWan3Uf"
Cancel-Lock: sha1:4Mkg0bcQN6MDMiLzhuIwCKtfvbg=
In-Reply-To: <vdtp30$2hfu$1@tota-refugium.de>
View all headers

>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

Subject: Re: tablelist and unknow
From: nemethi
Newsgroups: comp.lang.tcl
Date: Sun, 6 Oct 2024 15:51 UTC
References: 1 2 3 4 5
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.tota-refugium.de!.POSTED!not-for-mail
From: csaba.nemethi@t-online.de (nemethi)
Newsgroups: comp.lang.tcl
Subject: Re: tablelist and unknow
Date: Sun, 6 Oct 2024 17:51:08 +0200
Message-ID: <vdublc$2t41$1@tota-refugium.de>
References: <vdrsom$r620$1@dont-email.me> <vdrt72$r620$2@dont-email.me>
<vds1gi$r620$3@dont-email.me> <vdtp30$2hfu$1@tota-refugium.de>
<21517282179411001@llp>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 6 Oct 2024 15:51:08 -0000 (UTC)
Injection-Info: tota-refugium.de;
logging-data="95361"; mail-complaints-to="abuse@news.tota-refugium.de"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:mJW3jstNpFkxwy37pgR+2ylOXhY=
In-Reply-To: <21517282179411001@llp>
Content-Language: en-US
X-User-ID: eJwFwQcBACAIBMBKMp4RR0D6R/AOYmTtajDFYpUmm86TC+rQBWMuV/SyV7iGo7Oe+EaP5fkZ3xES
View all headers

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

1

rocksolid light 0.9.8
clearnet tor