--- a/UIPainterView.st Tue Feb 03 17:17:10 1998 +0100
+++ b/UIPainterView.st Tue Feb 03 20:01:55 1998 +0100
@@ -502,22 +502,33 @@
!
generateActionMethodFor:aspect spec:protoSpec inClass:targetClass
- |selector args showIt code alreadyInSuperclass|
+ |selector args showIt code alreadyInSuperclass numArgs method|
selector := aspect asSymbol.
alreadyInSuperclass := targetClass superclass canUnderstand:selector.
- (selector numArgs) == 1 ifFalse:[
+ numArgs := selector numArgs.
+ method := aspect.
+
+ numArgs == 1 ifTrue:[
+ args := 'anArgument'.
+ showIt := ''' , anArgument printString , '' ...''.\'.
+ ] ifFalse:[
args := ''.
showIt := ' ...''.\'.
- ] ifTrue:[
- args := 'anArgument'.
- showIt := ''' , anArgument printString , '' ...''.\'.
+
+ numArgs ~~ 0 ifTrue:[
+ method := ''.
+
+ selector keywords keysAndValuesDo:[:i :key|
+ method := method, key, 'arg', i printString, ' '
+ ]
+ ]
].
code := '!!' , targetClass name , ' methodsFor:''actions''!!\\' ,
- aspect , args , '\' ,
+ method , args , '\' ,
' "automatically generated by UIPainter ..."\\' ,
' "*** the code below performs no action"\' ,
' "*** (except for some feedback on the Transcript)"\' ,