Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
CrossMorph
Last updated at 9:30 pm UTC on 1 January 2019
Copied from http://pharo.gforge.inria.fr/PBE1/PBE1ch12.html (PBE = Pharo by Example)

or more appropriately see Chapter 11 Section 4 in SBE (Squeak By Example) Version 2009-09-29


 Morph subclass: #CrossMorph 
    instanceVariableNames: ’’ 
    classVariableNames: ’’ 
    poolDictionaries: ’’ 
    category: ’PBE-Morphic’



 drawOn: aCanvas

    | crossHeight crossWidth horizontalBar verticalBar | 

    crossHeight := self height / 3.0 . 
    crossWidth := self width / 3.0 . 

    horizontalBar := self bounds insetBy: 0 @ crossHeight. 
    verticalBar := self bounds insetBy: crossWidth @ 0. 

    aCanvas fillRectangle: horizontalBar color: self color. 

    aCanvas fillRectangle: verticalBar color: self color

tagBeginner