tags:

views:

201

answers:

3

I'm writing a Cocoa application that installs itself as an menulet in the menu bar (i.e. like the volume or battery icons). When the program crashes, it isn't possible to use the Force-Quit dialog, because it doesn't show up in the list. Of course, I can still kill it using the command-line, but my users don't know how to do that. Is there any way to fix this, say by making the program show up in the Force-Quit dialog?

(Note: the app is Leopard only).

A: 

Not really an answer, but hopefully helpful still ...

I think that most people who know how to force quit also know they can kill a process in the activity monitor. Just make sure it's not named '93AZkZ' or something.

rpflo
They don't need to know how to force quit for it to be a problem, though. “After I installed your app, my laptop started getting really warm!” [because it's running at 100% CPU]
Peter Hosey
Actually, I'm asking the question exactly because some of my users *don't* know how to use activity monitor, but *do* know about force-quit! (Hey, I just work here. :-)
Winawer
A: 

You could provide a PreferencePane for your application that can send the proper signal to it, if you want to allow users an easy way to shut it down or restart it. This is the pattern that MySQL uses on OS X.

Shaggy Frog
Huh. That's a lot of overhead for a lightweight program that sits in the menu bar ... but maybe that's what I'll have to do if nothing else comes along. Or I guess I could just make it crash-proof. <laugh>
Winawer
Well it's not about being lightweight. It's "what choices do I have to provide access to a (mostly) faceless process?". Besides telling your users to go to the Activity Monitor, or use `ps`, there isn't much else you can do. How about a Dashboard widget?
Shaggy Frog
Fair enough. If the problem continues to bother people, I may have to adopt one of those solutions. Thanks for the insight. :-)
Winawer
+1  A: 

To be honest, the proper solution is to make sure your app never hangs or crashes for users. This should be your #1 priority, rather than figuring out how to let users deal with crashes and hangs. Obviously it isn't always possible to make sure your app never breaks in these ways, but it should definitely be the exception rather than the rule.

On another note, MenuExtras is a private API which I hope you aren't using to create your "menulet". Rather, the public class NSStatusItem (part of Cocoa) is the Apple-approved, recommended way to install icons into your menu bar.

Steven Degutis
That's what I wanted to say. I wouldnt want to use a menulet application that had the potential to hang.
Karl