Hello,

It seems that you have forgotten to retain the status item right after
its creation. Moreover, some code seems redundant (the first line is
not necessary).

I suggest you to read this tutorial about NSStatusItem:
http://www.mactech.com/articles/mactech/Vol.24/24.07/NSStatusitem/index.html
. It can help you in case of trouble.

Regards, Laurent Etiemble.

2010/1/29 Yvan Janssens <y...@yvansoftware.be>:
> Hi,
>
> I'm calling the following code in a AwakeFromNib:
>
>                        _statusItem = new NSStatusItem();
>                        NSMenu menu = new NSMenu("");
>                        _statusItem = 
> NSStatusBar.SystemStatusBar.StatusItemWithLength(32);
>                        _statusItem.Image = NSImage.ImageNamed("twitter");
>                        NSMenuItem menuItem = new NSMenuItem("Send tweet!",new 
> IntPtr(),"");
>                        menuItem.ActionEvent += new 
> ActionEventHandler(showTweetWindow);
>                        menu.AddItem(menuItem);
>                        _statusItem.Menu = menu;
>
> What am I doing wrong to get my NSStatusItem? I "translated" this code
> from an Objective-C sample...
>
> Yvan
>

Reply via email to