NSstatusitem popover menu

Finding out why 2 lines of code don’t work is very hard. Make an example and either put it on Dropbox, your ftp server or send it directly to Christian.

[quote=309796:@Roland Maszlag]Sorry if i was not clear, i would like a small window that appears below the statusmenu icon. The window should contain some controls for example: 2 textfields next to each other, 2 buttons.
Im using a simple window with dark style. It appears when i click on the icon,
I thought there are better ways to implement it.
There is a good example in the mbs plugins, but it does not have controls. The one with controls gives errors, that i mentioned above,[/quote]

That is why I suggested Bill Gookin’s solution, which is based on window.

Well, if the examples coming with my plugins don’t work, please send me email with details.
Like error messages or screenshots.

[quote=309808:@Christian Schmitz]Well, if the examples coming with my plugins don’t work, please send me email with details.
Like error messages or screenshots.[/quote]
I just opened the example you suggested, but i can provide files/screenshots tomorrow.

I just run the “Statusitem with PopOver” example. Shows status item and when I click on the text, it shows the popover.
Same for the example “Statusitem with PopOver using Container” where I see the textarea and I can type text.
No problem here.

PS: Please make sure you have MBS Plugins installed: Cocoa, CocoaBase, Main, Util and Lion.

[quote=309936:@Christian Schmitz]I just run the “Statusitem with PopOver” example. Shows status item and when I click on the text, it shows the popover.
Same for the example “Statusitem with PopOver using Container” where I see the textarea and I can type text.
No problem here.

PS: Please make sure you have MBS Plugins installed: Cocoa, CocoaBase, Main, Util and Lion.[/quote]
Downloaded the complete package from the webpage, now it works.
Unfortunately, it says my license is too old for the plugins.

[quote=309996:@Roland Maszlag]Downloaded the complete package from the webpage, now it works.
Unfortunately, it says my license is too old for the plugins.[/quote]
Radical idea: how about downloading the last version that your licence covers?

Alternative: upgrade to newest version.

[quote=309998:@Markus Winter]Radical idea: how about downloading the last version that your licence covers?

Alternative: upgrade to newest version.[/quote]
Could not find any older version.

Ahem, Roland: it took me about a second to change the download url from let’s say 165 to 164 to get an older version. You can always contact Christian directly, if you have a problem. You have now been working on this since the 11th.

I combined the popover examples that Christian suggested with one of the vibrancy example project i’ve found on the forum. Now it works, looks as i wanted. Thank you guys.

The small window shows up at the mouse posX, is there a way to place it in the middle of the nsstatusmenu instead of centering it around the mouse pointer and placing it on the top?

The show method of NSPopOver expects a Rect, a view (read that as control) and a preferred edge to show. So yes, depending on what PopOver you are using, pass it the control.handle, the rect of the statusmenu and the edge you would prefer. If the popover wouldn’t fit, macOs will place it on a different edge, but always related to the control.
https://developer.apple.com/reference/appkit/nspopover/1532113-show

Check the example how it positions the popover.
Maybe you can play with the coordinates passed and change the offset a bit to the left/right.

Christian’s two examples already do exactly that. The window is placed centrally in relation to the NSStatusItem, not to where the mouse pointer is clicked.

[quote=310289:@Christian Schmitz]Check the example how it positions the popover.
Maybe you can play with the coordinates passed and change the offset a bit to the left/right.[/quote]
Thanks, i’ve found the MyNSStatusItemMBS.window.left and width propetry. Used theese vars to center the custom view.