Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Writing software is more fun than working.


devel / comp.lang.tcl / Display a text string in a text window?

SubjectAuthor
* Display a text string in a text window?snosniv
`- Display a text string in a text window?Rich

1
Display a text string in a text window?

<6abb2c3a-627d-48c2-abc4-ed93c91c35cbn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:620a:2154:b0:6f9:6c61:ea58 with SMTP id m20-20020a05620a215400b006f96c61ea58mr8270257qkm.518.1668350859370;
Sun, 13 Nov 2022 06:47:39 -0800 (PST)
X-Received: by 2002:ac8:7ed3:0:b0:3a5:274c:6118 with SMTP id
x19-20020ac87ed3000000b003a5274c6118mr8782066qtj.425.1668350859189; Sun, 13
Nov 2022 06:47:39 -0800 (PST)
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: Sun, 13 Nov 2022 06:47:38 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=82.1.128.13; posting-account=gstOigoAAADV9pmzZL58qQ436SKV3SBu
NNTP-Posting-Host: 82.1.128.13
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6abb2c3a-627d-48c2-abc4-ed93c91c35cbn@googlegroups.com>
Subject: Display a text string in a text window?
From: nivpars...@gmail.com (snosniv)
Injection-Date: Sun, 13 Nov 2022 14:47:39 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1823
 by: snosniv - Sun, 13 Nov 2022 14:47 UTC

So, I have a few procs that write a list to a global variable called zdat, and just the workout "type" to a global called znam

Below is a sample
puts $zdat
{WARM 5 0 120 140 80} {BLCK 20 0 180 90} {COOL 5 0 130 100 85}
puts $znam
WARM BLCK COOL

I'd like to display one of them (or both maybe) somewhere in another frame in my GUI.
I have 5 frames that ADD stuff, WARM (warm-up), BLCK (Steady Block), COOL (cool-down), INTV (Intervals)! & MBLK (multi-block), each one can add the the vars zdat & znam.
Each time new data is added to zdat I'd like to refresh what's shown
It will help with tracking what is being built as my zwift workout.

I have a working script, but adding this display text feature will make it easier to track what's been added so far. (There will probably only be 6 or 7 max in zdat/znam

TIA, Kev P.

Re: Display a text string in a text window?

<tkr20c$1fpm1$1@dont-email.me>

  copy mid

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

  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: Display a text string in a text window?
Date: Sun, 13 Nov 2022 15:20:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <tkr20c$1fpm1$1@dont-email.me>
References: <6abb2c3a-627d-48c2-abc4-ed93c91c35cbn@googlegroups.com>
Injection-Date: Sun, 13 Nov 2022 15:20:45 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="68b437dec4a5be227b72d3e8ca065776";
logging-data="1566401"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX188zJ9eRTaLfLy7FXyXWzwi"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:ld//Zhl3qPZ9saY7fygRQaaWIwM=
 by: Rich - Sun, 13 Nov 2022 15:20 UTC

snosniv <nivparsons@gmail.com> wrote:
> Each time new data is added to zdat I'd like to refresh what's shown
> It will help with tracking what is being built as my zwift workout.

Look into adding a write trace on zdat that calls a proc that uses the
zdat contents to "insert" text lines into a text widget (whether you
clear the widget first is up to you).

Once setup, every time a write happens to the zdat variable, your proc
will refresh the contents of the text widget.

Do be careful about "too much data" (which will probably take you some
time to encounter) but if you end up needing to insert many thousands
of lines then this can become a bit of a performance issue.

Where to "place/pack/grid" the text widget is also up to you.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor