Three beginner's questions

Andreas Raab raab at isgnw.cs.Uni-Magdeburg.DE
Fri Jan 30 00:08:48 UTC 1998


Philippe,

> 1) What is the easiest way to draw a graphical object (e.g., a line)?
> Can you draw in the Workspace or must you draw on a special canvas?
> Could you provide a simple example?

Have a look at class Canvas. The easiest way to draw a line is probably:

(FormCanvas on: Display) 
  line: 0 at 0 to: 1000 at 1000 width: 1 color: Color black

or, using a more general representation

(Line from: 0 at 0 to: 1000 at 1000 withForm: (Form extent:1 at 1 depth:1) fillBlack)
  display

The latter allows more general lines as for instance in:

(Line from: 0 at 0 to: 1000 at 1000 withForm: Form fromUser) display

Hope that helps,
  Andreas
-- 
Linear algebra is your friend - Trigonometry is your enemy.
+===== Andreas Raab ============= (raab at isg.cs.uni-magdeburg.de) =====+
I Department of Simulation and Graphics      Phone: +49 391 671 8065  I
I University of Magdeburg, Germany           Fax:   +49 391 671 1164  I
+=============< http://isgwww.cs.uni-magdeburg.de/~raab >=============+





More information about the Squeak-dev mailing list