Squeak newbie, writing first class 
Author Message
 Squeak newbie, writing first class

Quote:

> I recently started using Dolphin Smalltalk on Windows95 and Squeak 1.21
> on Linux.

Squeak 1.3 is now available.  You should upgrade.

Quote:
> How shall I enter my first class with Squeak?

Open a browser and select a category (or add a new one with the
"add item" operation in the menu) in the top-left pane.

Assuming you added a new category called "My Category", you will see a
template that looks like this in the lower pane:

    Object subclass: #NameOfClass
        instanceVariableNames: 'instVarName1 instVarName2'
        classVariableNames: 'ClassVarName1 ClassVarName2'
        poolDictionaries: ''
        category: 'My Category'

Edit this template, replacing "Object" with the class that you want to
subclass, "NameOfClass" with the name for your new class, and the two
strings defining the instance and class variables as appropriate (delete
the initial contents to leave empty strings if you don't want any
instance/class variables).

If you want to create a class that has indexable fields you should also
change "subclass:" to "variableSubclass:" [pointer fields],
"variableByteSubclass:" [byte fields], or "variableWordSubclass:" [32-bit
integer fields] as appropriate.

Then choose "accept" from the menu in the lower pane to create the class.

Your class will appear in the class list, with a single entry in the
protocol list saying "no messages".  Select this and you will see another
template in the lower pane that you can edit (and "accept") to add
methods to your class.

Quote:
> Also, what is the right forum for asking questions about Squeak usage?

You could post them here, or you could subscribe to the Squeak mailing
list and post them there (for a faster turnaround ;).  To add or remove
yourself, send mail to:


with with a subject line of "subscribe" or "unsubscribe".

Ian



Wed, 18 Jun 1902 08:00:00 GMT  
 Squeak newbie, writing first class

  Posted/Mailed

Quote:

>I recently started using Dolphin Smalltalk on Windows95 and Squeak 1.21
>on Linux.  In Dolphin I can start a new Class like this.  Open a Class
>Hierarchy Browser, select a Class to subclass, select the new menu
>option,  enter a name for the new class.  How shall I enter my first
>class with Squeak?

  Bear in mind I'm somewhat clueless with Squeak so there may well be
  a better way...

  Bring up the menu for the Squeak screen, and then select 'open...',
  followed by 'open browser'.

  You'll then get a browser for all the classes in the system.

  Select the category you want your class to be in in the left-most
  pane [bring up the menu again in this pane if you want to create
  a new category].

  A default class definition will appear in the bottom editing pane.
  Alter this as needed and then select the whole definition and 'do it',
  this runs the code in the definition which adds the class to the
  system.

  The 'accept' menu option only works when you're changing an
  existing definition.  You may need to switch away from and back
  to your category for the browser to be refreshed after you add a
  class.

  This is in 1.23 on Win95, I believe that 1.30 is currently just
  hot off the servers and I don't believe it's images are compatible
  with earlier versions, so you might want to think about upgrading
  before doing any serious work.  Then again you might want to wait
  a little while to see whether any killer bugs turn up in the latest
  and greatest version (-;

Quote:
>Also, what is the right forum for asking questions about Squeak usage?

  comp.lang.smalltalk is probably fine, but I've only been lurking
  here a few days.  You might want to put [Squeak] in the subject line
  if it's a specific to Squeak question.  This appears to be the
  convention here.

  There's also a mailing list for Squeak.

  Send mail with the subject 'subscribe', to:


  ...at least that's how I got on to it (-;

-- Kapusniak, Stefan m



Wed, 18 Jun 1902 08:00:00 GMT  
 Squeak newbie, writing first class


Quote:
>change "subclass:" to "variableSubclass:" [pointer fields],
>"variableByteSubclass:" [byte fields], or "variableWordSubclass:" [32-bit
>integer fields] as appropriate.

This always confused, WHAT exactly is the usage of the
various variableSubclass statements.

Greetz,

RS



Wed, 18 Jun 1902 08:00:00 GMT  
 Squeak newbie, writing first class

I am another squeak newbie. My q is how do you start running this class
after you are done creating it. Also how do you get access to a console for
basic user input and response? Isnt there a "hello world" for squeak
somewhere out there?

Quote:


>>change "subclass:" to "variableSubclass:" [pointer fields],
>>"variableByteSubclass:" [byte fields], or "variableWordSubclass:" [32-bit
>>integer fields] as appropriate.

>This always confused, WHAT exactly is the usage of the
>various variableSubclass statements.

>Greetz,

>RS



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Squeak newbie, writing first class

2. The first periodical on Squeak: Squeak News e-zine

3. The first periodical on Squeak: Squeak News e-zine

4. LSP and constructors with first-class classes

5. First class classes

6. [SQUEAK]Read/Write Source Files In Portable ANSI SIF

7. File Read/Write in Squeak

8. csyScan - Class(y) class scanner written in Python

9. Squeak - A Usable Smalltalk written in itself

10. Squeak - A Usable Smalltalk written in itself

11. squeak smalltalk for high school class, lesson plans?

12. Also looking for a TimeSlicer class (Squeak)

 

 
Powered by phpBB® Forum Software