Hi Ed,

I agree that this is a good effect for add-gadget.

We also want a similar effect for track-add, grid-add, and maybe others.

It should completely eliminate the need for these utility words:

- with-gadget
- make-gadget
- track,
- grid,
- gadget,
- g
- g->

Check out the usages of the above (especially in ui.tools), and you'll
see that for the most part they exist to eliminate 'over's. There's
also g and g->, I think those won't be needed either if new accessors
are used.

The other change I want to make is have the *-theme words have a
pipeline effect ( gadget -- gadget ). Their use is always preceded by
a 'dup' (its always in a constructor). Again, with the new setters
this will come out nice.

When we talked about an 'UI overhaul' recently, what I mostly had in
mind was the switchover to inheritance, together with the above
changes. I know you have bigger ideas, but we can tackle the above
changes first.

Feel free to go ahead and make these changes; but be warned, there's a
lot of code to update. Let me know if you have questions, need help,
or if you'd like me to do parts/all of it (I can't give a timeframe
for help though, I'm busy with the compiler and web framework for the
forseeable future).

Slava

On Sat, Jul 12, 2008 at 4:44 PM, Eduardo Cavazos <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Here's the old 'automata-window*':
>
> ----------------------------------------------------------------------
> : automata-window* ( -- ) init-rule set-interesting <frame>
>
> {
> [ "1 - Center"      [ start-center    ] view-button ]
> [ "2 - Random"      [ start-random    ] view-button ]
> [ "3 - Continue"    [ run-rule        ] view-button ]
> [ "5 - Random Rule" [ random-rule     ] view-button ]
> [ "n - New"         [ automata-window ] view-button ]
> } make*
> [ [ gadget, ] curry ] map concat ! Hack
> make-shelf over @top grid-add
>
> [ display ] closed-quot <slate> { 400 400 } over set-slate-dim dup >slate
> over @center grid-add
>
> {
> { T{ key-down f f "1" } [ [ start-center    ] view-action ] }
> { T{ key-down f f "2" } [ [ start-random    ] view-action ] }
> { T{ key-down f f "3" } [ [ run-rule        ] view-action ] }
> { T{ key-down f f "5" } [ [ random-rule     ] view-action ] }
> { T{ key-down f f "n" } [ [ automata-window ] view-action ] }
> } [ make* ] map >hashtable <handler> tuck set-gadget-delegate
> "Automata" open-window ;
> ----------------------------------------------------------------------
>
> Rewritten:
>
> ----------------------------------------------------------------------
> : automata-window* ( -- )
>  init-rule
>  set-interesting
>
>  <frame>
>
>    <shelf>
>
>      "1 - Center"      [ start-center    ] view-button add-gadget
>      "2 - Random"      [ start-random    ] view-button add-gadget
>      "3 - Continue"    [ run-rule        ] view-button add-gadget
>      "5 - Random Rule" [ random-rule     ] view-button add-gadget
>      "n - New"         [ automata-window ] view-button add-gadget
>
>    @top grid-add
>
>    C[ display ] <slate>
>      { 400 400 } >>dim
>    dup >slate
>
>    @center grid-add
>
>  H{ }
>    T{ key-down f f "1" } [ start-center    ] view-action is
>    T{ key-down f f "2" } [ start-random    ] view-action is
>    T{ key-down f f "3" } [ run-rule        ] view-action is
>    T{ key-down f f "5" } [ random-rule     ] view-action is
>    T{ key-down f f "n" } [ automata-window ] view-action is
>
>  <handler>
>
>    tuck set-gadget-delegate
>
>  "Automata" open-window ;
> ----------------------------------------------------------------------
>
> It's alot less crufty now. It doesn't use 'make*'. It doesn't use 'gadget,'.
> I'm using alternative versions of 'add-gadget' and 'set-gadget-delegate':
>
>        add-gadget ( parent child -- parent )
>
>        grid-add ( grid child i j -- grid )
>
> Slava, I'm pretty sure we both agreed that these should be the effects a while
> back. I'm just refreshing the issue because I just got around to rewriting
> this.
>
> Ed
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Factor-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to