# Pocket Smalltalk Introduction

> New! You can now view the entire tutorial as one big file by clicking here. You can also download the entire thing in a zip file by clicking here.

> The purpose of this tutorial is to give a novice Pocket Smalltalk user the necessary information to get moving with PST quickly. I just started with PST a few months ago myself, so I was preparing to write this document while I was learning how to use PST. There is an excellent tutorial that is distributed with the PST package, and I highly recommend that you read it. However, it is the standard "Hello, World!" program that seems to be mandatory for every programming language in existence. It shows you how to get the PST environment running, and then how to create a program with a single button that, when pressed, will popup an alert saying "Hello, World!" What I want to do is take you further than that.

> I think you can put most tutorials into three categories:

> 1. Those that try to show every component of the system all at once
> 2. Those that are based on difficult concepts such as mathematics or computer graphics, and
> 3. Those that are so simple as to show you nothing new

> The problem with the first group is that it makes it too easy for the novice to get lost. If you are trying to learn a new language or environment, there is a limit to the number of features or components that can be demonstrated in a single application, yet still make sense to the reader. The second group suffers from the fact that the reader may not understand the principles on which the program is based, and will therefore spend an inordinate amount of time trying to understand the "domain" problem, and not enough on the way the system works. A good example of that is the number of books on JavaTM that think a good first example is a class to represent Complex numbers. Math has never been my strong suit, and Complex numbers, with an imaginary part always seemed wonky to me. Since I had trouble with the underlying "problem", the example was not as effective on me. The third group's problem is that the example is so simple that it doesn't show you how to do anything useful. I hope to avoid all three of these groups' problems.

> I will begin by talking a little about the Pocket Smalltalk environment and how to use the development tools. If you already understand this, you can skip ahead. I think it's important to include this information in case this is a new user's first exposure to the system. We will then build a "real" application from start to finish. The application is one that I built from scratch while learning the system, and with this tutorial in mind. It contains text fields, a drop-down listbox, a button, a menu bar, and a menu with a couple of menu items. That sounds like a lot (or not much, depending on your experience), but I think it will provide a good introduction to the system.

> Before getting started, you need to ensure that you have all of the necessary tools. The first thing you need is, obviously, Pocket Smalltalk. If you have not already done so, you can obtain it from the Pocket Smalltalk website. The current version of Pocket Smalltalk is 1.5. You will also need to get the Palm resource compiler, PilRC. You can get it from the PilRC website. The current version of PilRC is 2.4. And finally, since we will be doing some double precision math, you will need to get the MathLib kit for the Palm. It is available from the MathLib Information Page. The .prc file in this distribution provide double precision math support for the Palm. You will need to load it onto your Palm, and the Emulator if you use it, for our program to work. (Don't worry, the math I'm talking about is very simple!)

> You will also need a tool to unzip the archives that these tools come in. Be sure to use an unzip tool that can deal with long filenames. Unzip all three tools to appropriate locations (I used C:\PocketSmalltalk, C:\PilRC and C:\MathLib, respectively). Once you've installed these tools, you're ready to proceed.

> ### Sections

> 0 | Overview of Pocket Smalltalk
> | 1 | Setting Up The Packages
> 2 | Creating The Resources
> 3 | Defining The Constants
> 4 | Writing Code: The Class and Class-Side Methods
> 5 | Writing Code: Instance Methods
> 6 | Writing Code: Instance Methods (Actions)
> 7 | Final Steps
> 8 | Running Under POSE
> 9 | Wrap Up
> 10 | References

You are Smalltalker number
to have visited this tutorial.
Copyright © 2000 Joey Gibson