Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007
Squeak intro tutorial
If you've not gotten Squeak, please go ahead and do so. You can obtain squeak by going to the following website. http://www.squeak.org, and then install squeak.
Also at times take a look at the following Squeak jpg pictures. They will help you.
Once installation is complete, open up squeak by double clicking on the mouse icon. You should know how to do this, but we're telling you just in case.
Once squeak is opened you will see a GUI pop up with a read me file. Please peruse the file, as it is a good intro to squeak. You can close the file then by clicking on the little square box at the left hand top corner of the read me box, or if you wish to minimize, click on the right hand top corner box. You will notice sever Play with Me boxes minimized. These are projects that already come with squeak, and they give you a demonstartion of squeaks power. When you have time play around with them.
1. Missing File (/cs2340/uploads/SqueakGUI.jpg)
Now one thing you must realize is that Squeak does not have an API like Java does. Squeak is an OOP language, but it differs from java. Instead to find previous code for containers and various other programming tools, you use a system browser.
a) To open the system browser, right click on any open green area.
2. Missing File (/cs2340/uploads/SqueakMenu.jpg)
b) Select Open
3. Missing File (/cs2340/uploads/OpenMenu.jpg)
c) Select browser
A green box should open up. The browser is where you can access all your code once you're ready to use it. You create your classes within here.
2. Missing File (/cs2340/uploads/Browser.jpg)
Try a quick sample.
a) Right click within the top left frame.
This contains all your categories and classes that you use.
b) Then create a new one by clicking on add Item.
A white box with the default name Category-Name will open up.
c) Put in any name you like and hit enter.
Congrats you've created your first category, and now to it you can add classes.
There are three other things that you should not how to acess in Squeak at first.
Right click on the background again and choose the open option again.
Then click on Workspace. Workspace is a typing area where you can write and test code before placing it in the system browser. Try the following example in the workspace.
7+8. then hit Alt-P. 15 should print out.
However, this time pick transcript. Transcrip allows you a place to print to. Its sort of like a print statement in java. If you do a print transcript in squeak, you can see output of your program. This is useful in debuggin, as you can put print statements aboutto help debug.
Open up a workspace as well as a transcript box
Try the following:
n _ 'string.
Transcript show: n.
Highlight the code and right click. Choose accept it.
Then highlight the code again and choose do it.
string should appare in transcript.
4. Various items used in squeak
Missing File (/cs2340/uploads/SquaeakAll.jpg)
Finally anohter useful item is the open file option. Throught out the class you will creat .st files. once you write your program in the System browser, you port it out as an .st file. To do this you right click on your categor that you've created and choose the file out option. It will file out an .st file that will be in the same folder as where you opened squeak. On the same token, when attempting to load an .st file, you need to open it.
To do this right click on the background.
Then you navigate through the directory where your file is located.
Once opened, you need to highlight all the code within the file, and the right click.
Then choose the file in optionl. A Category should now be available in your system browser. You have sucessfully loaded the file.
Use this method when looking at our code for our Cases later on :).
Thats a basic tutorial that should help you get squeaking.
Link to this Page