Re: NSStatusBar generates Sigtrap
Re: NSStatusBar generates Sigtrap
- Subject: Re: NSStatusBar generates Sigtrap
- From: Rosyna <email@hidden>
- Date: Tue, 2 Aug 2005 08:57:21 -0700
There's no NSApplication instance here. And probably no connection to
the window server. And defnitely no Autorelease pool.
Put this code in a class and use NSApplicationMain() in main().
And you don't need to retain the systemStatusBar (not that it should
be valid in this case).
Ack, at 8/2/05, Michael Gruetzner said:
I've tried to add an item to the status bar. Therefore I wrote this
tiny program:
int main(int argc, char *argv[]) {
NSStatusItem *item;
NSStatusBar *bar = [[NSStatusBar systemStatusBar]retain];
item = [bar statusItemWithLength : NSVariableStatusItemLength];
[item retain];
[item setTitle: NSLocalizedString(@"Tablet",@"")];
[item setHighlightMode:YES];
[item setMenu:theMenu];
return 0;
}
I took the code from the example on the cocoa documentation. When I
run the code, the following happens:
--
Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug
Unsanity: Unsane Tools for Insanely Great People
_______________________________________________
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