Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
LayoutFrame example
Last updated at 3:01 pm UTC on 11 August 2020
From: http://smalltalkinsmallsteps.blogspot.co.uk/2015/11/creating-three-pane-window-using.html
Squeak_LayoutFrame_example_2015-11-18.png


 window := SystemWindow labelled: 'Layout'.
 
 redMorph := Morph new.
 window 
 addMorph: redMorph
 fullFrame: (LayoutFrame 
  fractions: (0@0 corner: 1@1)   
        "in fractions: the numbers represent a value from 0 to 1  
          i.e. a decimal fraction, of 100% of the parent window's size"
  offsets: (100@0 corner: 0@50 negated)).
        "in offsets: the numerics represent absolute values, in pixels"
redMorph color: Color red.
        "there is a set of named colors.  Color objects can also be specified as RGB values
          r:g:b:  Each parameter is a number between 0 and 1.0 "

"Two morphs side-by-side in a proportional layout will automagically have a grabbable, movable pane edge."

greenMorph := Morph new.
window 
 addMorph: greenMorph
 fullFrame: (LayoutFrame 
  fractions: (0@0 corner: 0@1)
  offsets: (0@0 corner: 100@50 negated)).
greenMorph color: Color green.

yellowMorph := Morph new.
window 
 addMorph: yellowMorph
 fullFrame: (LayoutFrame 
  fractions: (0@1 corner: 1@1)
  offsets: (0@50 negated corner: 0@0)).
yellowMorph color: Color yellow.

window openInWorld.  "sent to the superclass"