doru and lukas I was wondering why you did not use morphs for mondrian since I have the impression that for drag and drop alex is reinventing the morph event dispatch loop.
Stef
On Feb 2, 2009, at 1:56 PM, Alexandre Bergel wrote:
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 ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev