Using Squeak for general desktop development
Ned Konz
ned at squeakland.org
Tue Feb 10 20:48:06 UTC 2004
On Tuesday 10 February 2004 2:34 am, Mike Flippin wrote:
> I would be satisfied with just being able to open a small GUI app
> written for Squeak without the whole Squeak UI loading. Just have the
> Window show up and be able to point to it and say "This is a GUI example
> written in Smalltalk!" Is this possible? If there's any good FAQ or
> anything that addresses these sort of topics please let me know as I'll
> go there rather than take up people's time :)
But it already does this.
If your application can live in a single (OS) window, then ignore the
SystemWindow and friends and use the World as a container.
Try the attached file to see a silly little example of this. It makes a
Browser window, then makes the browser window the entire contents of the
World.
Save it to your Squeak directory, then do something like:
(on Unix):
cd /path/to/squeak
squeak squeak.image $PWD/fullWindowBrowser.st
(on Windows (I think)):
c:
cd \path\to\squeak
start squeak.image c:\path\to\squeak\fullWindowBrowser.st
No, I guess that doesn't work right because of a URL decoding bug. So don't
try this in Windows without first fixing FileUrl>>pathForFile.
Ned
-------------- next part --------------
b _ Browser openBrowser.
win _ b dependents detect: [ :ea | ea isKindOf: SystemWindow ].
World layoutPolicy: ProportionalLayout new.
World addMorph: win fullFrame: (LayoutFrame fractions: (0 at 0 corner: 1 at 1)).
win sendToBack.
win submorphs first delete.
#(labelArea labelString label stripes) do: [ :sym | win instVarNamed: sym put: nil ].
win borderWidth: 0.
win eventHandler: nil.
win layoutChanged.
World submorphs do: [ :ea | ea == win ifFalse: [ ea delete ]].
More information about the Squeak-dev
mailing list
|