bialpio
bialpio

Reputation: 1024

Dolphin Smalltalk - adding method

I am trying to create a custom class in Dolphin Smalltalk. When I open the Workspace, type in and evaluate the code:

Object subclass: #Sudoku
    instanceVariableNames: 'board'
    classVariableNames: ''
    poolDictionaries: ''
    category: 'JiPP SudokuSolver'.

everything works fine and the class is created and visible from Class Browser.

The problem is, I want to add custom member method to this class, but without using Class Browser. Is it possible from the Workspace? I want to have one file with all the source code, so I don't have to worry about saving entire image.

Upvotes: 4

Views: 650

Answers (2)

igouy
igouy

Reputation: 2692

I want to have one file with all the source code, so I don't have to worry about saving entire image.

What will be any easier about saving that one file than saving the image?

Is there a change.log file in the same directory as the image? Open it with a text editor and see what's in it.

Find out how to fileOut classes and methods using the ClassBrowser menus and then see what's in those text files.

(Do you have the Source Tracking System add on?)

Upvotes: 1

user296065
user296065

Reputation: 76

You can add a class method to a class using:

SomeClass class compile: 'method text'.

Instance method:

SomeClass compile: 'method test'.

The being said, why not you STS or FileOut your changes instead?

Upvotes: 1

Related Questions