Documentation > Working with PST v2.0a for Squeak
 
  • New to Squeak?
  • If you have never used Squeak Smalltalk, we can offer no better starting point than the official Squeak site, but here are some basics:

    The Squeak background provides access to all of the tools needed to do development. If you use the left mouse button to click on the background, you will get a menu. This menu provides access to any of the windows that are needed to do work. If you downloaded the basic package (which you must have if you are here), then using the right mouse button will provide you with a shorter menu providing you with access to the basic elements you will need.

    The look and feel of Squeak is quite different than anything you may be used to. Experiment and enjoy. The reason that Squeak is so different is that Squeak runs BIT-IDENTICAL on a multitude of platforms. This was the principal motivation to move PST from Dolphin to Squeak — a single IDE now works across all platforms.

    Squeak uses polling for the windows and buttons and such. What this means, is that if you click while Squeak is busy, it will never notice it. So if you think you pressed a button, and nothing is happening, then most likely Squeak was busy and never got the button press. Try it again. Polling also means that there is no such thing as double clicking. Instead, what you have is click-twice. What this means is that if you click twice in the same place, regardless of the amount of time that has gone by since the last click, a click-twice will be registered.

    Hang in there. Enhancements to the Squeak UI are forthcoming from the community. Squeak Smalltalk is supported by a large community effort, so a lot of help is available if you are willing to post questions on either the Pocket Smalltalk discussion Group, or the Squeak Mailing List.

    Now, take a deep breath, and follow the instructions in the next section.

     

  • Pocket Smalltalk Development Using Squeak

    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'

 

Last updated: Dec 7, 2001

Palm Powered is a trademark of Palm Inc. Pocket Smalltalk is trademark of Pocket Smalltalk Group. Copyright (c) 1998 - 2001 Pocket Smalltalk Group.