tags:

views:

58

answers:

2

Hi, 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.

+1  A: 

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?

Thanks, that's exactly what I meant. Unfortunately it's a bit uncomfortable, so I'll probably stick with the File Out.
bialpio
+1  A: 

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?)

igouy
"What will be any easier about saving that one file than saving the image?"Entire image file with one custom class is bigger than one file with all the code for the specific class.I've tried using File Out but can't input the result in the workspace.
bialpio
>> Entire image file with one custom class is bigger than one file << Why do you care about that?
igouy
>> but can't input the result in the workspace << Is there a File/File In menu item on the window? See http://www.object-arts.com/docs/workspace_files.htm
igouy