[HELP] Adjusting a TextMorph in a PasteUpMorph

Hannes Hirzel Hannes_Hirzel at compuserve.com
Sun Oct 17 15:51:32 UTC 1999


Hello

I¥m trying to construct a BookMorph by using Squeak code along the lines of
the following code snippet.

"=== Squeak as a report writer ==="

b := BookMorph new.

"--- disable page turning sound ---"
b setProperty: #transitionSpec toValue: 
(Array with: 'silence' with: #none with: #none).

"--- set page size ---"
b currentPage extent: 300 at 200.

"--- insert additional pages (of the same size) ---"
b insertPageColored: Color lightBlue.
b currentPage addMorph: EllipseMorph new.

b insertPageColored: Color lightBrown.
b currentPage addMorph: (EllipseMorph new color: Color red).

"--- insert a page with text ---"
b insertPageColored: Color yellow.
b currentPage addMorph: (t := TextMorph new fit; contents: 'aaa bbb ccc 
ddd eee fff ggg hhh iii  jjj kkk lll mmm nnn ooo ppp').

"--- try to adjust TextMorph to the page bounds ---"
" *** 1  b currentPage autoLineLayout: true; fixLayout; layoutChanged. "
" *** 2  t fillingOnOff. "  

b openInWorld.


This works fine without the statements marked "***". However my specific
question: Why doesn¥t the text in the TextMorph wrap within the page?
Either the statement marked "***1" nor the statement "***2" helps. The
second one even gives an error message. When using direct manipulation
(TextMorph -> menu -> "fill owner¥s shape") the message "fillingOnOff"
works fine. I¥m using Squeak version 2.5 on Windows.

Thank you in advance for your help. General suggestions on how to do for
example the layout on a page or for using bookmarks are also welcome. Just
in case you have a code snippet at hand for posting to the list ;-)


Hannes


P.S. Later on I¥ll try to do a reader which reads in simple HTML and does a
BookMorph





More information about the Squeak-dev mailing list