[Mondrian] MORectangleShape>>mightHaveChildren
by Alexandre Bergel
Dear List,
It appears that a rectangle shape in the Squeak version of Mondrian
may or may not have children. Conceptually, when a rectangle cannot
have children?
I am trying to figure out whether this something we should keep.
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
14 years, 1 month
Mondrian and events
by Alexandre Bergel
Dear list,
I enhanced Mondrian to support announcement based event. Here an
example:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| view |
view := MOViewRenderer new.
view subscribe: MOMouseEnter do:
[:ann | (ann element notNil and: [(ann element isKindOf: MORoot) not])
ifTrue: [MOPopup show: ann element printString]
ifFalse: [MOPopup remove] ].
view subscribe: MOMouseDown do:
[:ann | ann inspect].
view nodeShape: (MORectangleShape new width: 30; height: 40).
view nodes: (1 to: 5).
view open
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Two effects:
- putting the mouse over a box display a popup window.
- clicking on a box open an inspector
I propose an extension. I think this respects what was done in VW.
But maybe one wants to have different event handler regarding the
objects inserted. For example:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| view |
view := MOViewRenderer new.
view nodeShape: (MORectangleShape new width: 30; height: 40).
view subscribe: MOMouseDown do: [:ann | ann inspect].
view nodes: (1 to: 5).
view subscribe: MOMouseDown do: [:ann | Beeper beep].
view nodes: (5 to: 10).
view open
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Nodes from 1 to 5 will open an inspector when clicked.
Nodes from 1 to 10 will beep instead.
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
14 years, 1 month
Mondrian and Squeak: tooltip
by Alexandre Bergel
Hi again,
Tool tips are a kind of shape. I found that strange. In VW, a view
answers to the message interaction, returning an event handler. I like
this approach. Is there a reason why in Squeak it is so different?
Cheers,
Alexandre
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
14 years, 1 month
Mondrian in Squeak
by Alexandre Bergel
Dear List,
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
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
14 years, 1 month