links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Simple graphics capers
Last updated at 6:10 pm UTC on 2 October 2020
Have some fun with the Squeak display:

Fill the background with something on screen:
   (Form fromUser) setAsBackground
Fill the background with black circles:
   (Form dotOfSize: 25) setAsBackground

Scramble the display: (This is simplified by defining 'Point atRandom')
| p0 p1 offset | "temporary variables"
100 timesRepeat: [
 p1 := (World bounds corner x atRandom)@(World bounds corner y atRandom).
 p0 := (p1 x atRandom)@(p1 y atRandom).
 offset := (#(-1 1) atRandom)@(#(-1 1) atRandom).
 (Form fromDisplay: (Rectangle origin: p0 extent: p1))
  displayAt: p0 + offset. ]

Randall Bohn Tested, working in 'Squeak3.0 of 4 February 2001'

Retest: Works fine in Squeak 5.3.

Simple_graphics_capers_ 2020-10-02.png