The draw method is a simple one. It checks the shape attribute's value to determine which Smalltalk method to call for the actual drawing. This way, you can easily support many different kinds of shapes (including circles, triangles, and rectangles) in a single part class. This means you need to write two instance methods, draw, and circle.
draw "Draw the shape" self widget isNil ifFalse: [ self shape = 'circle' ifTrue: [self circle]. self shape = 'rectangle' ifTrue: [self rectangle]. self shape = 'triangle' ifTrue: [self triangle]. ].
Using perform: is actually better practice, but for simplicity this section uses the straight-forward approach. After you are adept at packaging and prerequisites you can consider using the perform: method.
Because the shape attribute has a value of 'circle' by default, the draw method will call the circle method:
circle "Ask the widget to draw a filled circle" self widget drawFilledCircle
The actual drawing commands are done by the widget, which you'll write in the next section. Later, you'll add the rectangle and triangle methods to support other kinds of shapes.