Newbie's question: how do you create a chessboard in Squeak?

Philippe de Rochambeau pr1 at club-internet.fr
Mon Apr 27 11:20:09 UTC 1998


Which of the addSubView commands would you use to create a chessboard-like
View containing 9 subviews?

-----------------
| XXXX VVVV XXXX |
| XXXX VVVV XXXX |
| XXXX VVVV XXXX |
| VVVV XXXX VVVV |
| VVVV XXXX VVVV |
| VVVV XXXX VVVV |
| XXXX VVVV XXXX |
| XXXX VVVV XXXX |
| XXXX VVVV XXXX |
------------------

I have tried using the "addSubView viewport:" command, computing each
subview's position based upon its neighbor's. However, that seems
unnecessarily tedious. Is there a better way of doing it?

Is there any algorithm in Squeak Smalltalk that lets you emulate Java's
FlowLayout algorithm?

Many thanks.

Philippe de Rochambeau





More information about the Squeak-dev mailing list