Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The nicest thing about the Alto is that it doesn't run faster at night.


devel / comp.lang.tcl / Re: default button appearance

SubjectAuthor
* default button appearancesaitology9
`* default button appearanceRich
 +* default button appearancesaitology9
 |`* default button appearanceRich
 | `- default button appearancesaitology9
 +- default button appearancesaitology9
 `- default button appearancesaitology9

1
default button appearance

<tjpj7n$7mj$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!a5rWVvs5S5ZXUwkNcVnRMw.user.46.165.242.75.POSTED!not-for-mail
From: saitolo...@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: default button appearance
Date: Mon, 31 Oct 2022 18:46:12 -0400
Organization: Aioe.org NNTP Server
Message-ID: <tjpj7n$7mj$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="7891"; posting-host="a5rWVvs5S5ZXUwkNcVnRMw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.3.2
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: saitology9 - Mon, 31 Oct 2022 22:46 UTC

Hello,

I have several buttons in a row and I would like one of the to be the
default so that the Enter key will invoke it. The user can tab over to
the other buttons to press Enter too.

Normally, there is a slight visual cue to the default button. I tried
"-default active", "-activebackground/-activeforeground", and several
others.

How do I achieve this?

Re: default button appearance

<tjpuei$k2ah$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ric...@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: default button appearance
Date: Tue, 1 Nov 2022 01:57:38 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <tjpuei$k2ah$1@dont-email.me>
References: <tjpj7n$7mj$1@gioia.aioe.org>
Injection-Date: Tue, 1 Nov 2022 01:57:38 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="976f85e8b9aa8267b18aa2f750b2de52";
logging-data="657745"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ulv14k0lFnCipgXU1MHRz"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:dceqsAynTyzB3fQgJO+tG3smlQg=
 by: Rich - Tue, 1 Nov 2022 01:57 UTC

saitology9 <saitology9@gmail.com> wrote:
> Hello,
>
> I have several buttons in a row and I would like one of the to be the
> default so that the Enter key will invoke it. The user can tab over to
> the other buttons to press Enter too.
>
> Normally, there is a slight visual cue to the default button. I tried
> "-default active", "-activebackground/-activeforeground", and several
> others.
>
> How do I achieve this?

If you want a key to invoke it, then you probably need to shift focus
to the button you want to be the default. Look up the 'focus' command.

But the default Tk bindings invoke the focused button using space, not
Enter, so you might also need to add a binding to the Enter key.

Look up the default Tk bindings for buttons and see how Tk does the
space bar binding, you can copy that one and connect it to Enter.

Re: default button appearance

<tjpv0q$1sug$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!a5rWVvs5S5ZXUwkNcVnRMw.user.46.165.242.75.POSTED!not-for-mail
From: saitolo...@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: default button appearance
Date: Mon, 31 Oct 2022 22:07:21 -0400
Organization: Aioe.org NNTP Server
Message-ID: <tjpv0q$1sug$1@gioia.aioe.org>
References: <tjpj7n$7mj$1@gioia.aioe.org> <tjpuei$k2ah$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="62416"; posting-host="a5rWVvs5S5ZXUwkNcVnRMw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.3.2
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: saitology9 - Tue, 1 Nov 2022 02:07 UTC

On 10/31/2022 9:57 PM, Rich wrote:
>
> If you want a key to invoke it, then you probably need to shift focus
> to the button you want to be the default. Look up the 'focus' command.
>
> But the default Tk bindings invoke the focused button using space, not
> Enter, so you might also need to add a binding to the Enter key.
>

My mistake: I should have said space not Enter.

> Look up the default Tk bindings for buttons and see how Tk does the
> space bar binding, you can copy that one and connect it to Enter.

My question was not about the behavior which works just fine. Rather my
question was that on my buttons, there is no visual indication as to
which one would be invoked if I hit the space bar. [focus] on the frame
or the any of buttons themselves doesn't seem to provide any visual clue.

Re: default button appearance

<tjpve1$u0$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!a5rWVvs5S5ZXUwkNcVnRMw.user.46.165.242.75.POSTED!not-for-mail
From: saitolo...@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: default button appearance
Date: Mon, 31 Oct 2022 22:14:24 -0400
Organization: Aioe.org NNTP Server
Message-ID: <tjpve1$u0$1@gioia.aioe.org>
References: <tjpj7n$7mj$1@gioia.aioe.org> <tjpuei$k2ah$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="960"; posting-host="a5rWVvs5S5ZXUwkNcVnRMw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.3.2
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: saitology9 - Tue, 1 Nov 2022 02:14 UTC

On 10/31/2022 9:57 PM, Rich wrote:
>
> Look up the default Tk bindings for buttons and see how Tk does the
> space bar binding, you can copy that one and connect it to Enter.

tk_dialog provides the visual clue I am talking about but [info body] on
it does not return anything.

# look at the yes button
package req Tk
tk_dialog .foo "The Title" "Do you want to say yes?" \
questhead 0 " Yes " " No " " I'm not sure "

Re: default button appearance

<tjpvi0$u0$2@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!a5rWVvs5S5ZXUwkNcVnRMw.user.46.165.242.75.POSTED!not-for-mail
From: saitolo...@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: default button appearance
Date: Mon, 31 Oct 2022 22:16:32 -0400
Organization: Aioe.org NNTP Server
Message-ID: <tjpvi0$u0$2@gioia.aioe.org>
References: <tjpj7n$7mj$1@gioia.aioe.org> <tjpuei$k2ah$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="960"; posting-host="a5rWVvs5S5ZXUwkNcVnRMw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.3.2
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: saitology9 - Tue, 1 Nov 2022 02:16 UTC

On 10/31/2022 9:57 PM, Rich wrote:
>
> Look up the default Tk bindings for buttons and see how Tk does the
> space bar binding, you can copy that one and connect it to Enter.

[info body] does return something to study. Thanks!

Re: default button appearance

<tjq3rd$n6cq$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ric...@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: default button appearance
Date: Tue, 1 Nov 2022 03:29:49 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <tjq3rd$n6cq$1@dont-email.me>
References: <tjpj7n$7mj$1@gioia.aioe.org> <tjpuei$k2ah$1@dont-email.me> <tjpv0q$1sug$1@gioia.aioe.org>
Injection-Date: Tue, 1 Nov 2022 03:29:49 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="976f85e8b9aa8267b18aa2f750b2de52";
logging-data="760218"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19BuZrjnb3/DOEk7v+bh8Eb"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:dvMh1BU7Bki3eF3aLBlpCvRkJ5g=
 by: Rich - Tue, 1 Nov 2022 03:29 UTC

saitology9 <saitology9@gmail.com> wrote:
> On 10/31/2022 9:57 PM, Rich wrote:
>>
>> If you want a key to invoke it, then you probably need to shift focus
>> to the button you want to be the default. Look up the 'focus' command.
>>
>> But the default Tk bindings invoke the focused button using space, not
>> Enter, so you might also need to add a binding to the Enter key.
>>
>
> My mistake: I should have said space not Enter.
>
>> Look up the default Tk bindings for buttons and see how Tk does the
>> space bar binding, you can copy that one and connect it to Enter.
>
> My question was not about the behavior which works just fine. Rather my
> question was that on my buttons, there is no visual indication as to
> which one would be invoked if I hit the space bar. [focus] on the frame
> or the any of buttons themselves doesn't seem to provide any visual clue.

X11/Linux/8.6.11:

$ rlwrap wish
% foreach i {1 2 3 4 5} { button .b$i -text .b$i ; pack .b$i -side left }
% focus .b4

When I hover over the window (I have Fvwm2 set for 'focus follows
mouse' mode) button .b4 has a darker border (and if I hit space while
the window is focused, button 4 is pressed).

See https://postimg.cc/Js4HD3VV

Re: default button appearance

<tjq586$1k51$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!a5rWVvs5S5ZXUwkNcVnRMw.user.46.165.242.75.POSTED!not-for-mail
From: saitolo...@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: default button appearance
Date: Mon, 31 Oct 2022 23:53:41 -0400
Organization: Aioe.org NNTP Server
Message-ID: <tjq586$1k51$1@gioia.aioe.org>
References: <tjpj7n$7mj$1@gioia.aioe.org> <tjpuei$k2ah$1@dont-email.me>
<tjpv0q$1sug$1@gioia.aioe.org> <tjq3rd$n6cq$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="53409"; posting-host="a5rWVvs5S5ZXUwkNcVnRMw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.3.2
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: saitology9 - Tue, 1 Nov 2022 03:53 UTC

On 10/31/2022 11:29 PM, Rich wrote:
>
> X11/Linux/8.6.11:
>
> $ rlwrap wish
> % foreach i {1 2 3 4 5} { button .b$i -text .b$i ; pack .b$i -side left }
> % focus .b4
>
> When I hover over the window (I have Fvwm2 set for 'focus follows
> mouse' mode) button .b4 has a darker border (and if I hit space while
> the window is focused, button 4 is pressed).
>
> See https://postimg.cc/Js4HD3VV
>

Thank you very much for the follow up. I reviewed the implementation of
tk_dialog and found out that the trick was to include [tkwait
visibility] right before doing any [focus] commands on the buttons.
Along with "-default active" option. Then the visual appearance
properly indicates which button is the default. Haven't tested it on Linux.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor