freeride-devel
[Top][All Lists]
Advanced

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

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


From: Rich Kilmer
Subject: [FR-devel] update to the 'commands' slot under components
Date: Fri, 15 Nov 2002 23:53:14 -0500

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

_______________________________
Rich Kilmer, InfoEther LLC
trap("SIGINT") { raise [104, 101, 108, 108].pack("cccc") }






reply via email to

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