Lab7


Lab 7: Drawing Letters as Graphics

In this lab, you'll start to explore how text is displayed as graphical objects in Squeak.

Chapter 19 of Goldberg and Robson's Smalltalk-80: The Language is all about Pens. Pens can be created and moved around the screen:

Pens actually draw right on the screen. You can blank out part of the screen using something like this:

        background := (Form extent: 400@400) fillWhite.
        background display.

Your Job: GraphicalText

Create a class GraphicalText that draws given characters on the screen at a specified height. You don't have to do all characters: the vowels (aeiou) and most used consonants (shrdlt) are fine. Upper or lower case is fine, but your input will be mixed case. (Hint: asUppercase) We want to be able to use this class like this:

(GraphicalText new on: 'Hello' at: 10) display.

which should cause the letters "HELLO" (or "hello") to appear on the display, where the tallest character is 10 pixels high.

You will not be graded on graphical quality or presentation here -- readability is all that we want, and flexibility, so that all characters at all sizes could be done this way.

Turn in

Your filedOut GraphicalText class, using Minnow.

You can now Turnin your code by going to the turnin page for your appropriate section:

http://minnow.cc.gatech.edu/cs2390w98a -- (Section A)
http://minnow.cc.gatech.edu/cs2390w98b -- (Section B)
http://minnow.cc.gatech.edu/cs2390w98c -- (Section C)
http://minnow.cc.gatech.edu/cs2390w98d -- (Section D)
http://minnow.cc.gatech.edu/cs2390w98e -- (Section E)
http://minnow.cc.gatech.edu/cs2390w98f -- (Section F)

You will be prompted for a user name and password. Your user name is your name as it appears on the CS2390 Home page. Your password is your 9 digit social security or Student ID number WITHOUT DASHES!.

Click on the Turnin new project link. Select Lab 7 in the Assignment menu.

You will now paste the code into the text area of the turnin web page. Click on the Turnin button and you are done!


News Page | CS2390 Win'98 Home Page | CS2390 CoWeb | STABLE | BOOST
Questions/comments/concerns to guzdial@cc.gatech.edu
Page last updated 3/2/98; 10:58:56 AM