Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

<lilo> I've always wanted to have a web site with a big picture of a carrot on it


devel / comp.lang.tcl / Re: Flash label background

SubjectAuthor
* Flash label backgroundsnosniv
`* Re: Flash label backgroundRalf Fassel
 `- Re: Flash label backgroundsnosniv

1
Flash label background

<5d754bd2-489b-45e1-aa72-52dd46adbacbn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ad4:58a4:0:b0:56f:a4:d7f5 with SMTP id ea4-20020ad458a4000000b0056f00a4d7f5mr4186660qvb.5.1678971005266;
Thu, 16 Mar 2023 05:50:05 -0700 (PDT)
X-Received: by 2002:a05:6902:151:b0:afa:d8b5:8e82 with SMTP id
p17-20020a056902015100b00afad8b58e82mr25940242ybh.6.1678971004900; Thu, 16
Mar 2023 05:50:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.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: Thu, 16 Mar 2023 05:50:04 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=86.18.155.77; posting-account=gstOigoAAADV9pmzZL58qQ436SKV3SBu
NNTP-Posting-Host: 86.18.155.77
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5d754bd2-489b-45e1-aa72-52dd46adbacbn@googlegroups.com>
Subject: Flash label background
From: nivparsons@gmail.com (snosniv)
Injection-Date: Thu, 16 Mar 2023 12:50:05 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2008
 by: snosniv - Thu, 16 Mar 2023 12:50 UTC

I want to draw attention to the user when they change power mode.
So I've tried the following using the 'after' command, but not working.

label $f9.lb00 -text "Watts" -font {Arial 10 bold} -width 14 -bg lightblue1 -fg $Watt_Colgrid
$f9.lb00 -row 0 -column 0

proc togglePwr {} {
global POWsel f9
if {$POWsel == 1} {
# Power label
$f9.lb00 configure -text "Watts" -bg lightblue1 -fg $Watt_Col
after 500 $f9.lb00 configure -bg grey
after 500 $f9.lb00 configure -bg lightblue1
} else {
$f9.lb00 configure -text "FTP" -bg green-fg $FTP_Col
after 500 $f9.lb00 configure -bg grey
after 500 $f9.lb00 configure -bg green
}
}

So, ignoring the 'after' commands, the label changes text & colour just fine,
but I'd like to flash the background just a few times somehow?
The added after is not doing anything I can see.
The aim was to add a small loop of 'after' cmds to flash the bg 4 or 5 times,
I don't want it flashing permanently, just a few to get users attention.

TIA, Kev P.

Re: Flash label background

<ygawn3gohcq.fsf@akutech.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ralfixx@gmx.de (Ralf Fassel)
Newsgroups: comp.lang.tcl
Subject: Re: Flash label background
Date: Thu, 16 Mar 2023 16:17:57 +0100
Lines: 51
Message-ID: <ygawn3gohcq.fsf@akutech.de>
References: <5d754bd2-489b-45e1-aa72-52dd46adbacbn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net w60fMQBLgSucIqlK9c6CfQalkabH3EOkuR4KtrDuRb6icUCSg=
Cancel-Lock: sha1:GnhRQOStK2b6Q+LfYPtwWxNF1TQ= sha1:HnyOXYMTF+jNJpvlk7qK/vqz8YI=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
 by: Ralf Fassel - Thu, 16 Mar 2023 15:17 UTC

* snosniv <nivparsons@gmail.com>
| proc togglePwr {} {
| global POWsel f9
| if {$POWsel == 1} {
| # Power label
| $f9.lb00 configure -text "Watts" -bg lightblue1 -fg $Watt_Col
| after 500 $f9.lb00 configure -bg grey
| after 500 $f9.lb00 configure -bg lightblue1
| } else {
| $f9.lb00 configure -text "FTP" -bg green-fg $FTP_Col
| after 500 $f9.lb00 configure -bg grey
| after 500 $f9.lb00 configure -bg green
| }
| }
>
| So, ignoring the 'after' commands, the label changes text & colour just fine,
| but I'd like to flash the background just a few times somehow?
| The added after is not doing anything I can see.

It *is* doing something, but since you set up *two* after commands for
the same interval, they run immediately after each other, the second
undoing the effect of the first.

Either use
after 500 [list $f9.lb00 configure -bg grey]
after 1000 [list $f9.lb00 configure -bg lightblue1]
(note: different intervals) or set up a proc which gets a count as
argument, decrs the count and calls itself via [after] while the
count is > 0

proc do_n_times {n interval} {
# do something
puts "do_n_times $n $interval [clock milliseconds]"
incr n -1
if {$n > 0} {
after $interval [list do_n_times $n $interval]
}
}

do_n_times 5 500
=>
do_n_times 5 500 1678979708511
do_n_times 4 500 1678979709011
do_n_times 3 500 1678979709511
do_n_times 2 500 1678979710011
do_n_times 1 500 1678979710512

You may want to add arguments for the widgets to change etc.

HTH
R'

Re: Flash label background

<3d9e7d2f-0371-48d9-837d-84fde40d678en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:6214:18c1:b0:571:a8b0:48b1 with SMTP id cy1-20020a05621418c100b00571a8b048b1mr4870288qvb.0.1678982232699;
Thu, 16 Mar 2023 08:57:12 -0700 (PDT)
X-Received: by 2002:a25:9109:0:b0:b13:7a6:f462 with SMTP id
v9-20020a259109000000b00b1307a6f462mr14612767ybl.3.1678982232394; Thu, 16 Mar
2023 08:57:12 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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: Thu, 16 Mar 2023 08:57:12 -0700 (PDT)
In-Reply-To: <ygawn3gohcq.fsf@akutech.de>
Injection-Info: google-groups.googlegroups.com; posting-host=86.18.155.77; posting-account=gstOigoAAADV9pmzZL58qQ436SKV3SBu
NNTP-Posting-Host: 86.18.155.77
References: <5d754bd2-489b-45e1-aa72-52dd46adbacbn@googlegroups.com> <ygawn3gohcq.fsf@akutech.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3d9e7d2f-0371-48d9-837d-84fde40d678en@googlegroups.com>
Subject: Re: Flash label background
From: nivparsons@gmail.com (snosniv)
Injection-Date: Thu, 16 Mar 2023 15:57:12 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2899
 by: snosniv - Thu, 16 Mar 2023 15:57 UTC

On Thursday, 16 March 2023 at 15:18:03 UTC, Ralf Fassel wrote:
> * snosniv <nivpa...@gmail.com>
> | proc togglePwr {} {
> | global POWsel f9
> | if {$POWsel == 1} {
> | # Power label
> | $f9.lb00 configure -text "Watts" -bg lightblue1 -fg $Watt_Col
> | after 500 $f9.lb00 configure -bg grey
> | after 500 $f9.lb00 configure -bg lightblue1
> | } else {
> | $f9.lb00 configure -text "FTP" -bg green-fg $FTP_Col
> | after 500 $f9.lb00 configure -bg grey
> | after 500 $f9.lb00 configure -bg green
> | }
> | }
> >
> | So, ignoring the 'after' commands, the label changes text & colour just fine,
> | but I'd like to flash the background just a few times somehow?
> | The added after is not doing anything I can see.
> It *is* doing something, but since you set up *two* after commands for
> the same interval, they run immediately after each other, the second
> undoing the effect of the first.
>
> Either use
> after 500 [list $f9.lb00 configure -bg grey]
> after 1000 [list $f9.lb00 configure -bg lightblue1]
> (note: different intervals) or set up a proc which gets a count as
> argument, decrs the count and calls itself via [after] while the
> count is > 0
>
> proc do_n_times {n interval} {
> # do something
> puts "do_n_times $n $interval [clock milliseconds]"
> incr n -1
> if {$n > 0} {
> after $interval [list do_n_times $n $interval]
> }
> }
>
> do_n_times 5 500
> =>
> do_n_times 5 500 1678979708511
> do_n_times 4 500 1678979709011
> do_n_times 3 500 1678979709511
> do_n_times 2 500 1678979710011
> do_n_times 1 500 1678979710512
>
> You may want to add arguments for the widgets to change etc.
>
> HTH
> R'

Thanks Ralf, I misunderstood the 'after', thinking they were sequential.


devel / comp.lang.tcl / Re: Flash label background

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor