If you are already
familiar with Squeak, then doing development with Pocket Smalltalk
should be a breeze. Most of the tools that you are already
familiar with, are used as is within a Pocket Smalltalk environment.
Please keep in mind
that we will often mention the expressions: Squeak environment,
and Pocket Smalltalk environment. The reason is that
the two are actually quite separate. While in the Squeak
environment, you will be able to do things to Squeak classes
and maybe augment or fix bugs in the Pocket Smalltalk base
system. While in the Pocket Smalltalk environment, you
will be able to do things to Pocket Smalltalk classes.
These are classes that will exist within your Pocket Smalltalk
applications. Things get VERY interesting when you start inter-mixing
the two environments. It is very easy to switch back
in forth from a Pocket Smalltalk project, to a standard Morphic
or MVC project.
Creating a Pocket
Smalltalk Project
There are two ways to
create a Pocket Smalltalk Project. The first is to evaluate
the following expression in a Workspace, or any text pane
that allows a doIt
PstSqueakProject openNewMorphic
The second way, assuming
you did not get rid of the personalized menu method (see:
system modifications
for more information), then there should be a New PST Project
menu option on the right button menu of the Squeak background.
This has the same identical result as the above expression.
Note: currently only
Morphic projects are supported, but this will change, we may
add MVC project support (as an historical detail, MVC is the
original UI delivered with Smalltalk-80, while Morphic is
a more modernized and more powerful UI built for Squeak).
A new Pocket Smalltalk
project is empty. There are no methods, and only a handful
of classes. The classes that are there are needed for
the system to operate properly. The only case this is
not true, is if a Pocket Smalltalk project is created within
another. The nested one will have the same classes as
its parent project.
Entering a Pocket
Smalltalk Project
The newly created project
can be entered by left clicking within the bounds of the Project
window. Once you enter a Pocket Smalltalk environment,
you no longer have access to the Squeak classes directly.
You must use the 'previous project' menu option from the background
menu in order to return to the world of Squeak.
Setting up Core and
Forms
A new Pocket Smalltalk
project has no code contained within it. So to get the core
classes and support for Palm UI elements, use the following
expressions
PstSqueakTools sifFileIn:
'core.sif'.
PstSqueakTools sifFileIn:
'forms.sif'.
This of course assumes
that the files 'core.sif' and 'forms.sif' are in the same
directory as the Squeak image you are running.
Migrating from a
1.5 project
Version 2.0 provides
for backward compatibility for code written using Version
1.5. Use the following expression to get this old code
in
PstSqueakTools pstProjectFileIn:
'your filename here'.
Code can be filed out
by using
PstSqueakTools sifFileOutPackage:
'core'
The name within the
quotes is the name of the System Category where your code
is.
Additional details on
migrating from v1.5 are available on a separate
page.
Creating an Application
to run on Palm OS
A subclass of PstPalmSqueakPackageSpecification
must be created. NOTE: If you createOnce you have
created your own subclass, you can go ahead and start adding
information about what and how this application should be
contained within it. This class provides reasonable defaults
for most things, here are some that must be specified by you
defaultApplicationFileName
" ^ <String>
"
^'you file name here'
Provide the name of
the .PRC file you wish to have created. Currently
you must make sure you include the file extension '.prc'
defaultApplicationName
" ^ <String>
"
^'Your application name'
Provide the name under
which to display this on the Palm device launcher.
Once you have built
a package specification, you are ready to create the .PRC
file. Here is the expression you will need
PstPalmSqueakTestPackageSpecification
createPackage
This will create a .PRC
file based on the information you provided.
Evaluating Expressions
Support for this is
very limited no Pocket Smalltalk code can be invoked
yet. Remember that while you are within a Pocket Smalltalk
project, not everything is as you might think. Example,
in Squeak the global variable Smalltalk is a SystemDictionary.
While in Pocket Smalltalk the global variable Smalltalk is
the class Smalltalk.
Returning to Squeak
Environment
Use the Previous
Project menu option from the background menu, or 'jump
to project...'.
Saving your Work
Remember that Squeak
is image based. What this means is that if you do some
work, you must save the image, unless you wish to trash whatever
you have done since the Squeak image was saved.
You can also file out
your code by
PstSqueakTools sifFileOutPackage:
'your system category name'