freeride-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [FR-devel] update to the 'commands' slot under components


From: Curt Hibbs
Subject: RE: [FR-devel] update to the 'commands' slot under components
Date: Sat, 16 Nov 2002 00:10:24 -0800

Rich Kilmer wrote:
>
> Team,
>
> Per Laurent I've updated the renderers to have methods for each
> 'commands' slot that a GUI renderer 'implements'...and changed the term
> 'commands' to 'actions' so as not to have confusion with Command
> objects.
>
> Right now, some GUI components present an object API that is fullfilled
> by a renderer through a set of databus slots via mounted Procs.  So,
> under editpane we have this method:
>
> editpane.cut
>
> which does:
>
> plugin['actions/cut'].call
>
> Then in EditPaneRenderFox we have:
>
> def cut
>   ... send command to scintilla control to perform cut
> end
>
> slot['actions/cut'].set_proc method(:cut)
>
> Now when editpane.cut is called, and it calls the proc slot, it calls
> the method 'cut' on EditPaneRenderFox!  What is cool is the 'method'
> method returns a Method object which presents the same invocation
> interface ('call', 'arity') as Procs...so can be stored directly in a
> Proc slot.
>
> This is essentially how it works, the details take into account some
> syntactic sugar, but I think:
>
> A) The term "actions" is a better word than "commands"
> B) Having each implemented action in its own method in
>    the renderer is easier to edit/document.
> C) Thanks for the push Laurent :-)
>
> This is all committed to CVS.
>
> -rich

Good work, I like this! And I agree that "actions" is a better term in this
case.

Curt





reply via email to

[Prev in Thread] Current Thread [Next in Thread]