Dynamic Web Development with Seaside

4.2.1Defining a Component

There are two ways to define the new WebCounter subclass of WAComponent.

Type the following class definition into the GemStone/S Transcript window or a GemStone workspace, then type CTL-d or use the "doit" menu item. Note that this GemStone/S class definition is slightly different than it would be in Squeak. The Squeak form works equally well, however you’ll always see class definitions in the GemStone/S form when you browse the class.

WAComponent subclass: 'WebCounter'
instVarNames: #(count)
classVars: #()
classInstVars: #()
poolDictionaries: #[]
category: 'GettingStarted'

WAcomponent subclass template

Alternatively, open a GemStone/S System Browser on the class WAComponent and fill in a "subclass template" as shown in Figure 34. To do this, click the green "Browse" button in the GemStone/S Transcript window, and type WAComponent into the popup. Left click WAComponent and then select the "subclass template" menu item. After filling in the template with the class definition above, type CTL-s or select the "accept" menu item.

Copyright © 19 March 2024 Stéphane Ducasse, Lukas Renggli, C. David Shaffer, Rick Zaccone
This book is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 license.

This book is published using Seaside, Magritte and the Pier book publishing engine.