View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Scratch 'N' Squeak: Adventures in Squeak

quite possibly the best case page ever made.

team scratch and squeak

(send fanmail to
being seen makes us happy, and dressing up is fun

Here's our final project for the pda. fileIn the entire changeset, go to a workspace, type "Calendar show" and alt+d it.

Our particular squeaky adventure does not seem as if it would be entirely helpful to future squeak pilgrims. The offer we make is a veritiable cornucopia, overflowing with the smalltalk equivalents of maize and turkey. Wooo. Get out the Allan Kay commemorative napkin rings and wash your hands. The feast is Squeak.

The mission:

1. Moving code around the group. sigh.

Changesets are fairly reasonable, and at times convenient. First get your basic image. Clean out all the junk that irritates you (the mouse, for example... you alt+leftClick it and then hit that X that appears top left in the halo). Once it's stripped down, save the whole image again (left click the background, save), and use that to load up squeak from now on.

Now you make a blank changeset. Left click, changes, create new change set. If you choose a useless name, you can rename the files (whatever.cs) after you file them out. Write your code for the day, left click on the background, changes, file out current change set. you can now close squeak without saving.

To load your code back in, load up your blank image, then drag the changeset file onto the squeak background thing. A purple box shows up. Right click. Filein entire file. That'll put you right back where you were when you filed out. If you want to merge your code with someone else's, filein all of your code, then drag their changeset on, and right click, changelist browser. You'll see a lot of confusing lines of garbage. Have your buddy sitting beside you tell you exactly which functions he changed, scan down until you see those function names, click them all, and then file in selections.

Never have more than one person working on the same function, or even class if possible, because combining code will become a hellish inferno of terrible pain.

Combining code should be a group activity. Have one person get everyone's latest changesets, combine them all, and set them back out to everyone. Don't work while code is being combined. Wait until everyone has fresh versions. Don't let everyone try to combine code. Just one guy. It's his job. He's the changeset guy. Ours was Mark.

Once you've brought in all the changesets, test it, file out a changeset, and pass that out to everyone. They can blindly file it all in to a blank squeak image and if the changeset guy was on the ball, everything will work fine.

1 1/2. A very good feature. in squeak
Squeak has the best feature ever. Seriously. For real.
In the browser where you are diligently coding, there's a button that says "versions". You click it, and every saved copy of that function ever made is there in its pristine state, before you went and exploded it. You'll notice that my dynamic and modular numbering system allowed me to slip this one in here after the fact. Thats the sort of design prowess you can expect to control yourself after just a semester (or, to my everlasting shame, two semesters) of squeaking.

Another great feature is the hierarchy button on the browser. If you are using a ScrollPane (or whatever else) and need to know if it has functions to do whatever, hit the hierarchy button and browse the classes above it. They might be holding what you need.

2. Convincing something to appear on the screen
You can type this in the workspace, highlight it all, and hit alt+d to see what is going on. Or put it in a class function and run that.

win _ SystemWindow new.
win openInWorld;
topLeft: 0@0;
height: 300;
width: 300;
color: Color blue;
borderColor: Color black;
setLabel: 'squeakity squak'.

Some notes about what you are seeing.

3. Hooking up buttons

tempButton _ SimpleButtonMorph new label: dayNum printString;
color: Color red;
borderColor: Color black;
borderWidth: 2;
topLeft: 20@20;
height: 25;
width: 25;
target: self;
actionSelector: #clickADay:;
arguments: (Array with: dayNum).

win addMorph: tempButton

4. Pictures
bgImage _ Form fromFileNamed: 'pdamonth2.gif'.
addMorph: bgImage asMorph
frame: (0.0 @ 0.0 extent: 1.0 @ 1.0).

Dates. I'm not numbering anymore
aDate _ '7/11/04' asDate.
aDate _ aDate subtractDays: 3.
aDate _ aDate addDays: 80.
aDate weekdayIndex.

Good built in functions that handle wrapping around months and years and such all on their own.
weekdayIndex will give you a number that lets you figure out whether a day is monday, tuesday, etc.

aSecondDate _ aDate asString asDate.

Make a clean copy of a date by going off of its string value instead of just pointing at the same thing.

Important note: You may have noticed the use of asString and asDate above. These are very useful when working with Squeak's built in objects. It turns out when you want something as something else, it's usually very easily done. If you have trouble with asString, try asText.


Doing random stuff

How to use our project as a reference
The three categories are down at the bottom in the left most pane of the browser. milestone1, m2, and icalendar. m2 has all the gui stuff in it. thats probably what will be the most helpful to you.

Link to this Page