mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 21:17:03 +00:00
Added makeObjectsPerformSelector:withObjects:.
Reviewed by me.
This commit is contained in:
+8
-3
@@ -1050,7 +1050,7 @@ var STICKY_TIME_INTERVAL = 500,
|
||||
[_menuView setFont:aFont];
|
||||
}
|
||||
|
||||
- (void)setBackgroundStyle:(_CPMenuWindowBackgroundStyle)aBackgroundStyle
|
||||
+ (CPColor)backgroundColorForBackgroundStyle:(_CPMenuWindowBackgroundStyle)aBackgroundStyle
|
||||
{
|
||||
var color = _CPMenuWindowBackgroundColors[aBackgroundStyle];
|
||||
|
||||
@@ -1092,8 +1092,13 @@ var STICKY_TIME_INTERVAL = 500,
|
||||
|
||||
_CPMenuWindowBackgroundColors[aBackgroundStyle] = color;
|
||||
}
|
||||
|
||||
[self setBackgroundColor:color];
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
- (void)setBackgroundStyle:(_CPMenuWindowBackgroundStyle)aBackgroundStyle
|
||||
{
|
||||
[self setBackgroundColor:[[self class] backgroundColorForBackgroundStyle:aBackgroundStyle]];
|
||||
}
|
||||
|
||||
- (void)setMenu:(CPMenu)aMenu
|
||||
|
||||
@@ -602,6 +602,23 @@
|
||||
objj_msgSend(self[index], aSelector, anObject);
|
||||
}
|
||||
|
||||
- (void)makeObjectsPerformSelector:(SEL)aSelector withObjects:(CPArray)objects
|
||||
{
|
||||
if (!aSelector)
|
||||
[CPException raise:CPInvalidArgumentException reason:"makeObjectsPerformSelector:withObjects: 'aSelector' can't be nil"];
|
||||
|
||||
var index = 0,
|
||||
count = length,
|
||||
argumentsArray = [nil, aSelector].concat(objects || []);
|
||||
|
||||
for(; index < count; ++index)
|
||||
{
|
||||
argumentsArray[0] = self[index];
|
||||
objj_msgSend.apply(this, argumentsArray);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Comparing arrays
|
||||
/*!
|
||||
Returns the first object found in the receiver (starting at index 0) which is present in the
|
||||
|
||||
Reference in New Issue
Block a user