• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Dockling not working, at all, no clue why!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dockling not working, at all, no clue why!


  • Subject: Dockling not working, at all, no clue why!
  • From: Stevos <email@hidden>
  • Date: Sat, 06 Apr 2002 16:44:33 -0600

First of all, I know Apple is like no-no'ing Docklings these days, but then
again a dockling is way faster than a App Dock Menu thing if you're just
doing the dockling. Anyways, I grabbed the template from StepWise, and I was
on my way. This is the MyDockling.m file, and it has 0 errors. However, the
dockling appears to do nothing! It just sort of hangs. I think this might be
because I am using find and that takes its bloody time, so I looked around
for a way to limit the depth that find searches, and I couldn't find it
(yes, I checked man find, but I couldn9t decipher that). So I guess my first
question is how do I limit the depth of find. I guess we'll go from there.
My code is below:

#import "MyDockling.h"
#import <CoreFoundation/CoreFoundation.h>

@implementation MyDockling
//Override this method to perform your own initialization
-(id)initWithBundle:(NSBundle*)bundle window:(NSWindow*)window
{
[super initWithBundle:bundle window:window];
return self;
}

-(BOOL)isMenuChanged
{
return YES;
}

-(NSMenu*)menu
{
find=[[NSTask alloc] init];
[find setLaunchPath:@"usr/bin/find"];
[find setCurrentDirectoryPath:@"/Applications"];
[find setArguments:[NSArray arrayWithObjects:@"/Applications", @"-name
*.app"]];
[find setStandardOutput:theApps];
[find launch];
for(i = 0; i < [theApps count]; i++)
{
menuItem = [[NSMenuItem alloc] addItemWithTitle:[[[theApps
objectAtIndex:i] stringByDeletingPathExtension] lastPathComponent]
action:@selector(itemSelected:) keyEquivalent:@""];
[menuItem setRepresentedObject:[theApps objectAtIndex:i]];
[menu addItem:menuItem];
[menuItem release];
}
[self setMenu:menu];
return [super menu];
}
-(void)itemSelected:(id)sender
{
NSString *path = [sender representedObject];
[[NSWorkspace sharedWorkspace] openFile:path];
}
@end


-Stevos
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Dockling not working, at all, no clue why!
      • From: "Craig S. Cottingham" <email@hidden>
    • Re: Dockling not working, at all, no clue why!
      • From: Jay Vaughan <email@hidden>
    • Re: Dockling not working, at all, no clue why!
      • From: Kent Sutherland <email@hidden>
    • Re: Dockling not working, at all, no clue why!
      • From: Andy Lee <email@hidden>
  • Prev by Date: include a framework with application
  • Next by Date: Re: Color entire table view row
  • Previous by thread: include a framework with application
  • Next by thread: Re: Dockling not working, at all, no clue why!
  • Index(es):
    • Date
    • Thread