Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

OS/2 must die!


devel / comp.lang.tcl / Re: How do I force focus on a widget?

SubjectAuthor
* How do I force focus on a widget?fr
`- How do I force focus on a widget?Luc

1
Re: How do I force focus on a widget?

<e64a5933-7feb-42f4-8697-1e396adca49bn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ac8:5bc9:0:b0:39a:348b:857e with SMTP id b9-20020ac85bc9000000b0039a348b857emr28890670qtb.462.1666641350444;
Mon, 24 Oct 2022 12:55:50 -0700 (PDT)
X-Received: by 2002:a05:620a:2591:b0:6c9:cc85:87e3 with SMTP id
x17-20020a05620a259100b006c9cc8587e3mr24054184qko.577.1666641350241; Mon, 24
Oct 2022 12:55:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Mon, 24 Oct 2022 12:55:50 -0700 (PDT)
In-Reply-To: <20221022210429.62b6051a@lud1.home>
Injection-Info: google-groups.googlegroups.com; posting-host=80.187.97.164; posting-account=aaGzBAoAAADO0Qsz99jkqns7nnqZHQxI
NNTP-Posting-Host: 80.187.97.164
References: <20221022210429.62b6051a@lud1.home>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e64a5933-7feb-42f4-8697-1e396adca49bn@googlegroups.com>
Subject: Re: How do I force focus on a widget?
From: zaw...@gmail.com (fr)
Injection-Date: Mon, 24 Oct 2022 19:55:50 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2264
 by: fr - Mon, 24 Oct 2022 19:55 UTC

On Sunday, October 23, 2022 at 2:04:34 AM UTC+2, Luc wrote:
> My application runs this code at startup among other things:
>
> set ::WidgetThatHasFocusNow [focus]
> if {[string length $::WidgetThatHasFocusNow] <= 0} {
> puts "focus is on [focus]"
> }
>
> output:
> focus is on
>
>
> That means no widget has focus at startup.
>
> So I fixes it.
>
> set WidgetThatHasFocusNow [focus]
> if {[string length $::WidgetThatHasFocusNow] <= 0} {
> focus -force $::FileListColumn
> event generate $::FileListColumn <Up>
> puts "focus is on [focus]"
> } else {puts Eureka!}
>
> output:
> focus is on
>
> No, it still doesn't work. :-(
>
> But I also have this:
>
> bind $::FileListColumn <Key> {after idle [list p.Update.Widgets.On.Any.Action %K]}
>
> That prints/inserts the output of [focus] on a widget I keep around for debugging.
> So that widget gets focus when I press any key, but not until then in spite of my efforts.
>
> How can I force focus at startup programatically?
>
> TIA
>
> --
> Luc
> >>
What happens, when you insert a line with "update" or "update idletasks" before you query the current focus?

Re: How do I force focus on a widget?

<20221024194646.0e8e5271@lud1.home>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!r6rvMD/kH7SYp8HYhhmKcg.user.46.165.242.75.POSTED!not-for-mail
From: no...@no.no (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: How do I force focus on a widget?
Date: Mon, 24 Oct 2022 19:46:46 -0300
Organization: Aioe.org NNTP Server
Message-ID: <20221024194646.0e8e5271@lud1.home>
References: <20221022210429.62b6051a@lud1.home>
<e64a5933-7feb-42f4-8697-1e396adca49bn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="45116"; posting-host="r6rvMD/kH7SYp8HYhhmKcg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Newsreader: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Luc - Mon, 24 Oct 2022 22:46 UTC

On Mon, 24 Oct 2022 12:55:50 -0700 (PDT), fr wrote:

> What happens, when you insert a line with "update" or "update idletasks"
> before you query the current focus?

It works as intended, that's what happens. :-)

Just what I needed. Thanks!

--
Luc
>>

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor