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

Discussion 3 - Jeff Watson

Part One - Overcoming Problems

In detail, describe a problem that you experienced in Squeak. What was the problem? Why did it happen? How did you eventually overcome this problem?

In trying to add the automatically resizing text functionality to our project in M2, I was easily able to figure out a good process for determining when the text size needed to be changed. Unfortunately, I spent a great deal of time trying to figure out the right calls to make to actually change the text size. At first, I used 'scaleFactor:' (part of the Morph class, therefore available to all subclasses of Morph as well) to change the size of the text (the text is in a TextMorph). While this did technically accomplish the task, simply changing the scale factor made the text very difficult to read after only a few scalings. I then decided to attempt to change the actual font size of the text. I found many different methods that altered the font, but I was unable to find any that simply changed the font size without also setting the style, emphasis, etc. Even after finding these methods, I had trouble figuring our the right way to use them. This happened because I did not fully understand the different font-related classes and some of the terminology used in those classes confused me. I was finally able to resolve this problem using the 'beAllFont:' method in the TextMorph class. The following code will set the font to 'Accuny' and the font size to '10' (in the example, 'self' refers to a TextMorph):

self beAllFont: (StrikeFont familyName: 'Accuny' size: 10).

Part Two - Learning From Classmates

Discussion 3 - David Figlar
David describes a way to show a window listing all accesses to a particular instance variable in all classes. This is particularly useful in helping to understand how different methods in classes relate to one another when one is looking through code that he or she doesn't understand. Also, it can help the programmer visualize the way his or her own classes/methods are interacting.

Discussion 3 - Wes Floyd
Wes mentions a way to adjust syntax highlighting in squeak. Syntax highlighting is especially useful for novices who haven't yet completely grasped Squeak's syntax. Also advantageous is the ability to choose between different syntax highlighting schemes.

Links to this Page