Wanted: a simple tcl script that just displays text

Using applications, configuring, problems
Post Reply
Message
Author
brad_chuck
Posts: 286
Joined: Tue 16 Aug 2005, 03:47
Location: Appalachian Mountains

Wanted: a simple tcl script that just displays text

#1 Post by brad_chuck »

Does anyone know how to make a simple tcl script that just displays text?

I would like to display the output of a shell script ( standard out ) in a TCL script.

Thanks !
User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#2 Post by MU »

no, but you can do it without tcl.

Code: Select all

myscript.sh >/tmp/text.$$ && xmessage -center "`cat /tmp/text.$$`" ; rm -f /tmp/text.$$ 
example:

Code: Select all

ls >/tmp/text.$$ && xmessage -center "`cat /tmp/text.$$`" ; rm -f /tmp/text.$$ 
example: use cat to display a file instead of using an own script:

Code: Select all

cat /usr/share/doc/index.html>/tmp/text.$$ && xmessage -center "`cat /tmp/text.$$`" ; rm -f /tmp/text.$$ 
It looks more professional, if you use gxmessage instead of xmessage:
http://dotpups.de/dotpups/System_Utilit ... essage.pup

Mark
brad_chuck
Posts: 286
Joined: Tue 16 Aug 2005, 03:47
Location: Appalachian Mountains

That will not work.

#3 Post by brad_chuck »

Sorry I should give more info.. I am trying to make a battery monitor applet. So I need something in tcl or some other way to display the output of my script.

It outputs the info to standard out and the script needs to just display something like 94% and that is it. JWM will cut the border off. Something like the freememapplet.

I can get Xdialog to output something that works but JWM flips out when I try to put it in the task bar.

Thanks for your help MU. I should be more clear. :oops:
User avatar
cplater
Posts: 56
Joined: Sat 11 Jun 2005, 11:51
Location: Huntsville, Alabama

#4 Post by cplater »

For the simplest widget you can try:

Code: Select all

#!/usr/bin/wish
set MyText "1234 five six seven eight"
label .lbl -textvariable MyText
pack .lbl
You can test some of this out by opening a terminal and typing "wish" and entering the commands. When the value of MyText changes the text in the window will diplay the new string.
Post Reply