Navigation:  Tutorials > Beginners Guide to Smalltalk > Playing with Objects in the Playground >

Creating a Playground

Previous pageReturn to chapter overviewNext page

The Playground package introduces several new classes of object into your image. One of these is the Playground class itself, which represents the functionality behind a Playground window. Let's create such a window:

playground := Playground new.

 

Here we send a #new message to the Playground class and this results in a Playground window being created. You'll see this appear on your screen. The Smalltalk object that represents this window will also have been assigned to the playground workspace variable. We can use this to communicate with the Playground in subsequent examples.

Tip: we don't fully introduce the idea of classes until the later chapter on Classes and Methods. However, it should be apparent from what we have just done, i.e. sending a message to a class, that classes are indeed objects too. If this sounds odd, then don't worry at this stage. Just remember: in Smalltalk, everything is an object.

Arrange the Windows on the screen so you can simultaneously see the Playground and your current workspace.