Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Natural laws have no pity.


devel / comp.lang.tcl / Re: I can't bind number keys

SubjectAuthor
* I can't bind number keysLuc
+- Re: I can't bind number keysSchelte
`- Re: I can't bind number keysRich

1
I can't bind number keys

<20230513073241.06f2c54b@lud1.home>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22054&group=comp.lang.tcl#22054

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: I can't bind number keys
Date: Sat, 13 May 2023 07:32:41 -0300
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <20230513073241.06f2c54b@lud1.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="fdd77a91cccd54c2f323d433c6d08b4e";
logging-data="2187422"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18WGSTshxwBOzg9Kvj9T+AXZqnPymwrquo="
Cancel-Lock: sha1:wcGitHLEerrA1mQzlsDYLXXsgi8=
 by: Luc - Sat, 13 May 2023 10:32 UTC

I can't seem to bind any number keys on the top row. The number keys on
the numeric keypad work, but the top row keys won't.

What is going on? Some Linux limitation?

Example code:

package require Tk
wm withdraw .
toplevel .top -background #c0c0c0

ttk::treeview .top.tree -columns {} -yscrollcommand {.top.vbar set}
ttk::scrollbar .top.vbar -orient vertical -command {.top.tree yview}

grid .top.tree -row 0 -column 0 -sticky nsew
grid .top.vbar -row 0 -column 1 -sticky ns
grid columnconfigure . 0 -weight 1
grid rowconfigure . 0 -weight 1

..top.tree insert {} end -id root1 -text "Root 1"
..top.tree insert {} end -id root2 -text "Root 2"
..top.tree insert root2 end -id subroot1 -text "Sub Root 1"
..top.tree insert {} end -id root3 -text "Root 3"

focus .top.tree
..top.tree focus root1

# this works with or without Alt
bind .top.tree <KP_1> {puts "bang!"}
# this won't work at all
bind .top.tree <1> {puts "bang!"}

--
Luc
>>

Re: I can't bind number keys

<nnd$1b1472b0$3e8a748b@d8ef77a23583b0e3>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22055&group=comp.lang.tcl#22055

  copy link   Newsgroups: comp.lang.tcl
Date: Sat, 13 May 2023 13:14:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.10.1
Subject: Re: I can't bind number keys
Content-Language: en-US
Newsgroups: comp.lang.tcl
References: <20230513073241.06f2c54b@lud1.home>
From: nospam@wanadoo.nl (Schelte)
In-Reply-To: <20230513073241.06f2c54b@lud1.home>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <nnd$1b1472b0$3e8a748b@d8ef77a23583b0e3>
Organization: KPN B.V.
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe006.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 18
Injection-Date: Sat, 13 May 2023 13:14:22 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1150
 by: Schelte - Sat, 13 May 2023 11:14 UTC

On 13/05/2023 12:32, Luc wrote:
> # this works with or without Alt
> bind .top.tree <KP_1> {puts "bang!"}
> # this won't work at all
> bind .top.tree <1> {puts "bang!"}
>
It works. It just doesn't do what you think. Compare the two:
% bind foo <1> #
% bind foo <KP_1> #
% bind foo
<Key-KP_1> <Button-1>

If you omit the event type, Tk picks the most likely one.

Schelte.

Re: I can't bind number keys

<u3o6he$24dg1$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22057&group=comp.lang.tcl#22057

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: I can't bind number keys
Date: Sat, 13 May 2023 14:23:42 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <u3o6he$24dg1$1@dont-email.me>
References: <20230513073241.06f2c54b@lud1.home>
Injection-Date: Sat, 13 May 2023 14:23:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6dde842b30ad22f3a7813bd38cf75b43";
logging-data="2242049"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+pc+n33yX03tFztKC11IgH"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.19 (x86_64))
Cancel-Lock: sha1:5kFMe3CdlChTCUMc17PVl+tPMeU=
 by: Rich - Sat, 13 May 2023 14:23 UTC

Luc <luc@sep.invalid> wrote:
> I can't seem to bind any number keys on the top row. The number keys on
> the numeric keypad work, but the top row keys won't.
>
> What is going on? Some Linux limitation?

No.

> bind .top.tree <1> {puts "bang!"}

From the bind man page, in the "Event Details" section:

If a button number is given then type may be omitted: if will
default to ButtonPress. For example, the specifier <1> is
equivalent to <ButtonPress-1>.


devel / comp.lang.tcl / Re: I can't bind number keys

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor