With the understanding that: I might be missing some context or
use-case; that the behaviour has probably been inherited from
MOGridLayout; and you might not want to mess it for for backward
compatability, I'm going to have a nit-pick at the semantics of
ROGridLayout. The class comment says "A ROGridLayout places elements
as a grid."
By "grid", I had expected the usual definition [1] of "a network of
uniformly spaced horizontal and perpendicular" items
However I was surprised that ROGridLayout did not provide such
uniformly spaced items, as seen with the following script that produced
the attached ROGridLayout.png:
view := ROView new.
bytes := (0 to: 255) asOrderedCollection.
40 timesRepeat: [bytes add: 0 ].
bytes do:
[ :byte |
view add: ( ROElement on: byte) + ( ROLabel new text: [ :element |
element model printStringBase: 16 ] ).
].
ROGridLayout on: view elements.
view open.
For my requirements, thankfully this seems to have been addressed by
adding ROCellLayout**, with the class comment "A ROCellLayout is like
ROGridLayout. Elements of each column are centered along the same
vertical line. And elements of each row are centered along the same
horizontal line." In the script above repalcing ROGridLayout by
ROCellLayout produces attached file ROCellLayout.png. It looks much
better .
To me, ROCellLayout doesn't sound like the right name for its
behaviour, whereas ROGridLayout would be a perfect fit. The existing
ROGridLayout behaviour seems more a "block" or "rectangle" or layout.
So with that background, the questions I wanted raise were:
1. What is the use case for preferring the behaviour of ROGridLayout
over that of ROCellLayout ?
2. Can ROCellLayout replace the existing ROGridLayout, to remove its
"surprising" behaviour
3. What am I'm missing, or am I being needlessly controversial ? :)
cheers -ben
[1] http://www.merriam-webster.com/dictionary/grid
** From method versions this looks like ROCellLayout was added by Jura.
Good work and thanks.