Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated license, corrected category name, changed uses of NSMenuItem …

…protocol over to NSMenuItem class.
  • Loading branch information...
commit f554433625f73d707878b572c59c468ee4e5e59e 1 parent 67e2a78
@uliwitness authored
Showing with 45 additions and 7 deletions.
  1. +22 −3 NSMenu+DeepSearch.h
  2. +23 −4 NSMenu+DeepSearch.m
View
25 NSMenu+DeepSearch.h
@@ -3,7 +3,26 @@
// UKSyntaxColoredDocument
//
// Created by Uli Kusterer on Tue May 18 2004.
-// Copyright (c) 2004 M. Uli Kusterer. All rights reserved.
+// Copyright (c) 2004 Uli Kusterer.
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source
+// distribution.
//
/*
@@ -25,9 +44,9 @@
// Interface:
// -----------------------------------------------------------------------------
-@interface NSMenu (DeepSearch)
+@interface NSMenu (UKDeepSearch)
// Perform a deep search on a menu and its submenus: (returns NIL if the item couldn't be found)
--(id <NSMenuItem>) findItemWithTarget: (id)targ andAction: (SEL)action;
+-(NSMenuItem*) findItemWithTarget: (id)targ andAction: (SEL)action;
@end
View
27 NSMenu+DeepSearch.m
@@ -3,7 +3,26 @@
// UKSyntaxColoredDocument
//
// Created by Uli Kusterer on Tue May 18 2004.
-// Copyright (c) 2004 M. Uli Kusterer. All rights reserved.
+// Copyright (c) 2004 Uli Kusterer.
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source
+// distribution.
//
// -----------------------------------------------------------------------------
@@ -13,7 +32,7 @@
#import "NSMenu+DeepSearch.h"
-@implementation NSMenu (DeepSearch)
+@implementation NSMenu (UKDeepSearch)
// -----------------------------------------------------------------------------
// findItemWithTarget:andAction:
@@ -25,7 +44,7 @@ @implementation NSMenu (DeepSearch)
// 2004-05-18 witness Created.
// -----------------------------------------------------------------------------
--(id <NSMenuItem>) findItemWithTarget: (id)targ andAction: (SEL)action
+-(NSMenuItem*) findItemWithTarget: (id)targ andAction: (SEL)action
{
// Look in this menu:
int itemIndex = [self indexOfItemWithTarget: targ andAction: action];
@@ -35,7 +54,7 @@ @implementation NSMenu (DeepSearch)
// If not found, search our items' submenus:
NSArray* items = [self itemArray];
NSEnumerator* enny = [items objectEnumerator];
- id<NSMenuItem> currItem = nil;
+ NSMenuItem* currItem = nil;
while( (currItem = [enny nextObject]) )
{
Please sign in to comment.
Something went wrong with that request. Please try again.