Article View: comp.sys.amiga.tech
Article #13985Hello World in Tcl (Re: Programming MS-Windows vs. Amiga)
From: Karl Lehenbauer
Date: Fri, 02 Mar 1990 06:16
Date: Fri, 02 Mar 1990 06:16
31 lines
1654 bytes
1654 bytes
Here is a Hello World program in Tcl. It runs under my forthcoming alpha-2
release of Tcl.
--------------
window open hello 200 50 300 50 Hello
set message "Hello, world."
set width [display textwidth $message]
set height [display fontheight]
proc refresh_window {} {
global width height message
window blank hello
display move [expr {([window width hello] - $width) / 2}] [expr {([window height hello] - $height) / 2}]
display text $message
}
refresh_window
eventloop
-----------------
refresh_window is automatically called when the window is resized. Various
such routines exist for all the IDCMP message types. I'm changing this to
provide a way for you to ask routine named by you to be called when a given
IDCMP message comes in, on a window basis...maybe tomorrow.
I can't read the font off the command line yet, but the above will work
for different font sizes.
--
-- uunet!sugar!karl "As long as there is a legion of superheros, all else
-- can surely be made right." -- Sensor Girl
-- Usenet access: (713) 438-5018
Technical Details
Message-ID:
<5229@sugar.hackercorp.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!lavaca.uh.edu!uhnix1!sugar!karlReferences:
<1165@lpami.wimsey.bc.ca> <5214@sugar.hackercorp.com> <23118@usc.edu> <5219@sugar.hackercorp.com> <23157@usc.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!lavaca.uh.edu!uhnix1!sugar!karl From: karl@sugar.hackercorp.com (Karl Lehenbauer) Newsgroups: comp.sys.amiga.tech Subject: Hello World in Tcl (Re: Programming MS-Windows vs. Amiga) Message-ID: <5229@sugar.hackercorp.com> Date: 2 Mar 90 06:16:30 GMT References: <1165@lpami.wimsey.bc.ca> <5214@sugar.hackercorp.com> <23118@usc.edu> <5219@sugar.hackercorp.com> <23157@usc.edu> Reply-To: karl@sugar.hackercorp.com (Karl Lehenbauer) Organization: Sugar Land Unix - Houston Lines: 31