Here is a screenshot:


Menu are much nicer now. Menu appears and disappear by simply moving the mouse. 

Just to give a bit of context: We are not trying to make Roassal a GUI framework. Morphic and Spec do it nicely and there is no reason to compete. Instead, we just want to provide a very minimal set of widgets (for now buttons, simple menu, labels) to smoothen the user experience when interacting with data.

Cheers,
Pierre & Alexandre


On Dec 11, 2014, at 6:16 PM, Pierre CHANSON <chans.pierre@gmail.com> wrote:

Hi everyone,

I changed the RTMenuBuilder in Roassal2, especially it's behavior, default colors and added more features as the definition of the highlight color. 

I also changed a bit the architecture but could still be a lot improved. 
We can also add a lot of different features to really specify the look of the menu using the builder so let me know if you have any ideas, comments.

You can have a look with the example 06:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| v b |
    v := RTView new.
    
    b := RTMenuBuilder new view: v.
    b menu: 'add' submenu: '10' callback: [ 
        | es |
        es := (RTLabel new color: [ :tt| Color random ]) elementsOn: (1 to: 10).
        es do: [ :e | e translateTo: ((500 atRandom @ 500 atRandom) - (250 @ 250)) ].
        v addAll: es. 
        v canvas signalUpdate ].

    b menu: 'add' submenu: '20' callback: [ 
        | es |
        es := (RTLabel new color: [ :tt| Color random ]) elementsOn: (1 to: 20).
        es do: [ :e | e translateTo: ((500 atRandom @ 500 atRandom) - (250 @ 250)) ].
        v addAll: es. 
        v canvas signalUpdate ].

    
    b menu: 'remove' submenu: 'odd' background: (Color blue alpha:0.3) callback: [ (v elements select: [ :e | e model odd ]) do: #remove. v canvas signalUpdate ].
    b menu: 'remove' submenu: 'even' background: Color red callback: [ (v elements select: [ :e | e model even ]) do: #remove. v canvas signalUpdate ].

    b menu: 'shuffle' highlight: Color lightBlue callback: [ 
        | tra |
        tra := RTSmoothLayoutTranslator new.
        tra nbCycles: 0.5.
        (v elements do: [ :e | tra translate: e to: ((500 atRandom @ 500 atRandom) - (250 @ 250)) ]) ].        

    v open
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

sincerely yours,

Pierre Chanson
_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.