I've tried the following:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| view builder |
builder := MOFormsBuilder new.
builder column; left; pref.
builder row; left; row; left; row; left; pref.
builder x: 1 y: 1 add: (MORectangleShape new).
builder x: 1 y: 2 add: (MOLabelShape new).
view := MOViewRenderer new.
view node: #blah using: builder shape.
view open
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
A shape is simply added to the builder. If you execute the following code, you will not get what you expect (a text 'blah' below a rectangle). If you manage if get the hand back (Cmd-.), then you will see that the message width is sent to an instance of MOLabelShape. This method does not exist, thus raising an exception. I have several questions:
- How can a shape knows the width of the string it is supposed to display, if the shape does not know about what to display? The "what to display" is provided in the display:on: method.
- In VW, the LabelShape>>width returns a widthBlock. This variable does not exist in Squeak. Is there a reason why? Is there something very different regarding labels from the Squeak and VisualWorks version?
A more general question, tt seems that the strategy to compute width and height of label in VW differs in Squeak. Any reason for this?
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.