Re: Looking for example of this type of app.
Re: Looking for example of this type of app.
- Subject: Re: Looking for example of this type of app.
- From: Chase <email@hidden>
- Date: Sun, 19 Jun 2005 06:50:09 -0500
On Jun 19, 2005, at 6:22 AM, Paul Sargent wrote:
Hi people,
I'm looking for an example project which will show me how to
structure the app that I'm working on. The behavior I want is :
1) App starts up at login (so it'll be in startup items or something)
2) No windows, or dock icon are normally present.
3) There'll be a menu bar icon to get a preferences window up.
4) It will poll things in the background and raise windows when
various events occur. (Kicked off an NSTimer or something. This
part is pretty much done)
Any example code out there to show how something like this would be
done?
login items code:
http://www.cocoabuilder.com/archive/message/cocoa/2004/7/1/110831
http://www.wodeveloper.com/omniLists/macosx-dev/2001/June/msg00597.html
no dock item:
http://developer.apple.com/documentation/MacOSX/Conceptual/
BPRuntimeConfig/Concepts/PListKeys.html
(search page for LSBackgroundOnly and LSUIElement)
it's nothing more than adding a single key/value pair to your
info.plist file
for example:
<key>LSBackgroundOnly</key>
<string>1</string>
menu bar icon:
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSStatusBar.html
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSStatusItem.html
example:
NSStatusItem * statusitem = [[NSStatusBar systemStatusBar]
statusItemWithLength:NSVariableStatusItemLength];
[statusitem setView:myiconview];
[[[statusitem view] window] setDelegate:self];
// that last line redirects mouseclicks (among other things) to
whatever object you want, in this case self.
// on a mouse click, pop open your prefs window.
hope this helps.
- chase
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden