Article View: comp.windows.misc
Article #838Re: Does anyone really understand windows?
From: Hans-Martin Mosner
Date: Wed, 24 Feb 1988 16:49
Date: Wed, 24 Feb 1988 16:49
59 lines
2164 bytes
2164 bytes
Well, since everyone is posting Hello World in their favorite window
system, here's my Smalltalk-80 version.
This is typed in from a printout (the Mac on which I have written it does not
have a connection to this host yet), but I'm fairly sure I did not make
any typos...
'From Smalltalk-80, Version 2.2 of July 4, 1987 on 24 February 1988 at 5:07:07 pm'!
View subclass: #CenteredTextView
instanceVariableNames: 'paragraph '
classVariableNames: ''
poolDictionaries: ''
category: 'Hello'!
!CenteredTextView methodsFor: 'displaying'!
displayView
paragraph displayOn: Display
at: (paragraph boundingBox
align: paragraph boundingBox center
with: self insetDisplayBox center) origin
clippingBox: self insetDisplayBox
rule: 3
mask: Form black! !
!CenteredTextView methodsFor: 'private'!
setParagraph: aParagraph
paragraph _ aParagraph! !
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --"!
CenteredTextView class
instanceVariableNames: ''!
!CenteredTextView class methodsFor: 'instance creation'!
open: aTextOrString label: aString
| topView |
topView _ StandardSystemView
model: nil
label: aString
minimumSize: 50@40.
topView addSubView: (self text: aTextOrString).
topView controller open!
text: aTextOrString
^self new setParagraph: aTextOrString asParagraph centered;
borderWidth: 1! !
!CenteredTextView class methodsFor: 'examples'!
hello
"CenteredTextView hello"
self open: 'Hello World!" label: 'Hello'! !
--
Hans-Martin Mosner | Don't tell Borland about Smalltalk - |
hmm@unido.{uucp,bitnet} | they might invent Turbo Smalltalk ! |
------------------------------------------------------------------------
Disclaimer: Turbo Smalltalk may already be a trademark of Borland...
Technical Details
Message-ID:
<208@laura.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!mcvax!unido!laura!hmmReferences:
<1457@sugar.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!mcvax!unido!laura!hmm From: hmm@laura.UUCP (Hans-Martin Mosner) Newsgroups: comp.windows.misc Subject: Re: Does anyone really understand windows? Message-ID: <208@laura.UUCP> Date: 24 Feb 88 16:49:12 GMT References: <1457@sugar.UUCP> Reply-To: hmm@laura.UUCP (Hans-Martin Mosner) Organization: University of Dortmund, W-Germany Lines: 59