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 !
Wanted: a simple tcl script that just displays text
-
- Posts: 286
- Joined: Tue 16 Aug 2005, 03:47
- Location: Appalachian Mountains
no, but you can do it without tcl.
example:
example: use cat to display a file instead of using an own script:
It looks more professional, if you use gxmessage instead of xmessage:
http://dotpups.de/dotpups/System_Utilit ... essage.pup
Mark
Code: Select all
myscript.sh >/tmp/text.$$ && xmessage -center "`cat /tmp/text.$$`" ; rm -f /tmp/text.$$
Code: Select all
ls >/tmp/text.$$ && xmessage -center "`cat /tmp/text.$$`" ; rm -f /tmp/text.$$
Code: Select all
cat /usr/share/doc/index.html>/tmp/text.$$ && xmessage -center "`cat /tmp/text.$$`" ; rm -f /tmp/text.$$
http://dotpups.de/dotpups/System_Utilit ... essage.pup
Mark
-
- Posts: 286
- Joined: Tue 16 Aug 2005, 03:47
- Location: Appalachian Mountains
That will not work.
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.
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.
For the simplest widget you can try:
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.
Code: Select all
#!/usr/bin/wish
set MyText "1234 five six seven eight"
label .lbl -textvariable MyText
pack .lbl