Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Science and religion are in full accord but science and faith are in complete discord.


devel / comp.lang.tcl / Re: Is it possible to make a tcl script both graphical (tk) and console (tcl)?

SubjectAuthor
* Is it possible to make a tcl script both graphical (tk) andpd
`- Is it possible to make a tcl script both graphical (tk) andpd

1
Re: Is it possible to make a tcl script both graphical (tk) and console (tcl)?

<2b62dba1-2e01-4905-8ce3-a3ef5342bbb9n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ac8:5a89:0:b0:421:c458:1733 with SMTP id c9-20020ac85a89000000b00421c4581733mr321033qtc.7.1701045553156;
Sun, 26 Nov 2023 16:39:13 -0800 (PST)
X-Received: by 2002:a05:622a:209:b0:41b:8141:9132 with SMTP id
b9-20020a05622a020900b0041b81419132mr454258qtx.1.1701045552932; Sun, 26 Nov
2023 16:39:12 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fdn.fr!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Sun, 26 Nov 2023 16:39:12 -0800 (PST)
In-Reply-To: <bc4d1023-6d4e-4e9d-8753-2b30cc727aadn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=207.188.184.151; posting-account=fwjo5QoAAAAcS9TSqEAQL1VEl7b8nCOq
NNTP-Posting-Host: 207.188.184.151
References: <bc4d1023-6d4e-4e9d-8753-2b30cc727aadn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2b62dba1-2e01-4905-8ce3-a3ef5342bbb9n@googlegroups.com>
Subject: Re: Is it possible to make a tcl script both graphical (tk) and
console (tcl)?
From: eukel...@gmail.com (pd)
Injection-Date: Mon, 27 Nov 2023 00:39:13 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: pd - Mon, 27 Nov 2023 00:39 UTC

El lunes, 27 de noviembre de 2023 a las 1:25:06 UTC+1, pd escribió:

> So, my question, Is any way to merge a console app and a graphical app in the same tcl script?
>
> Really I'm wrapping the script in a starkit so another point of view is, is there any way to pack in a starkit (starpack) a console app and a graphical app deciding to call one or another based in some criteria?

Ok, I answer myself after simple testing, it's so easy to do that, simply refactor the script as:

----my.tcl---------------------------------------------------------
set cmd scite

if { $argc > 2 } {
puts "executing $cmd"
exec $cmd [lindex $argv 0] [lindex $argv 1] [lindex $argv 2]
exit
} else {

package require Tk

entry .e1 -textvariable p1
entry .e2 -textvariable p2
entry .e3 -textvariable p3
button .b -text "Do it" -command {exec $cmd $p1 $p2 $p3}
pack .e1 .e2 .e3 .b
} -----------------------------------------------------------------------

and execute it using tclsh rather than wish

sorry for that silly question!

regards

Re: Is it possible to make a tcl script both graphical (tk) and console (tcl)?

<167c5a3e-59c5-4577-8809-b45b076e4172n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:622a:400b:b0:41b:8260:99f2 with SMTP id cf11-20020a05622a400b00b0041b826099f2mr341919qtb.2.1701046951633;
Sun, 26 Nov 2023 17:02:31 -0800 (PST)
X-Received: by 2002:a17:90a:6587:b0:27f:fc05:3c0d with SMTP id
k7-20020a17090a658700b0027ffc053c0dmr2031779pjj.8.1701046951269; Sun, 26 Nov
2023 17:02:31 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.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: Sun, 26 Nov 2023 17:02:30 -0800 (PST)
In-Reply-To: <2b62dba1-2e01-4905-8ce3-a3ef5342bbb9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=207.188.184.151; posting-account=fwjo5QoAAAAcS9TSqEAQL1VEl7b8nCOq
NNTP-Posting-Host: 207.188.184.151
References: <bc4d1023-6d4e-4e9d-8753-2b30cc727aadn@googlegroups.com> <2b62dba1-2e01-4905-8ce3-a3ef5342bbb9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <167c5a3e-59c5-4577-8809-b45b076e4172n@googlegroups.com>
Subject: Re: Is it possible to make a tcl script both graphical (tk) and
console (tcl)?
From: eukel...@gmail.com (pd)
Injection-Date: Mon, 27 Nov 2023 01:02:31 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2030
 by: pd - Mon, 27 Nov 2023 01:02 UTC

El lunes, 27 de noviembre de 2023 a las 1:39:15 UTC+1, pd escribió:
> El lunes, 27 de noviembre de 2023 a las 1:25:06 UTC+1, pd escribió:
>
> > Really I'm wrapping the script in a starkit so another point of view is, is there any way to pack in a starkit (starpack) a console app and a graphical app deciding to call one or another based in some criteria?
> Ok, I answer myself after simple testing, it's so easy to do that, simply refactor the script as:

well not so easy after all, the problem arises when trying to make a starkit, if I use a tclkit with Tk I get the problem of emulated console since it seems to use wish or init tk somehow and if I use a tclkitsh then I don't have Tk, any idea? thanks

regards

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor