Hi guys, i would lile to display a popover window when i click on the icon / list title of an NSStatusmenu.
I tried the mbs plugin, but could not create a popover window.
example: https://koenig-media.raywenderlich.com/uploads/2015/03/The-Popover-2.png
You might want to have a look at https://github.com/UBogun/Xojo-AppleLib where I installed a demo. You should be able to translate that to MBS plugins of course too.
Thank you for the idea.
Im confused, got so many errors.
most of them: "This item does not exists Declare Function getbehavior Lib appkitlibnameSelector… "
Some of the files are missing or in the wrong folder?
Or maybe the problem is that im using xojo 2015r2.4 ?
Yes, thats the problem. I use external declares and CGFGloat if I remember correctly, these were introduced with 2015r3.
Did you try examples coming with MBS Plugins?
I only found one on the mbs webpage, where the instructor creates a menu with circle icons. Could not find a popover window + menuiem combo.
With the dtPlugins you can do this very easy.
There is an example that shows a container filled with controls in a popover linked to a NSStatusitem
With MBS this is also possible but it is a bit harder to do.
This should be the example:
Statusitem with PopOver using Container.rbp
in Cocoa/NSStatusitem
PS: Please download plugins with all the examples.
[quote=309237:@Christoph De Vocht]With the dtPlugins you can do this very easy.
There is an example that shows a container filled with controls in a popover linked to a NSStatusitem
With MBS this is also possible but it is a bit harder to do.[/quote]
i can’t find a working link to the dtplugins on the whole forum
[quote=309241:@Christian Schmitz]This should be the example:
Statusitem with PopOver using Container.rbp
in Cocoa/NSStatusitem
PS: Please download plugins with all the examples.[/quote]
I got an error:
This method extends class Control, but the base expression is class ContainerControl.
vcTask.view=conMain.NSViewMBS
You need to use the container and not the window:
vcTask = new NSViewControllerMBS
vcTask.view = CCPrivacy1.NSViewMBS
But I had to ask, too.
[quote=309343:@Beatrix Willius]You need to use the container and not the window:
vcTask = new NSViewControllerMBS
vcTask.view = CCPrivacy1.NSViewMBS
But I had to ask, too.[/quote]
The example is already written like you mentioned.
in the app open event:
s=new MyNSStatusItemMBS
...
s.conMain = Window1.ContainerControl11
In the MyNSStatusItemMBS action event:
vcTask = new NSViewControllerMBS
vcTask.view = conMain.NSViewMBS
If all you need is a menu, maybe a simple Contextual menu can do. Then there is no need for declares or plugins.
is there any other idea how to acomplish the one i posted in the topic?
i need this to display some strings and buttons, and maybe a list.
Does my example not work?
Any issues?
Michel, that’s not going to be helpful in achieving the OP’s goal - it’s a way to fake a popover and won’t work for displaying with a nsstatusitem.
Displaying and managing an NSStatus item is one thing, displaying a popover is another.
Since the OP keeps asking for propositions, in spite of having already several examples, why not add one ?
[quote=309581:@Christian Schmitz]Does my example not work?
Any issues?[/quote]
Hi Christian, i got some errors, you can check them above.
[quote=309611:@Michel Bujardet]Displaying and managing an NSStatus item is one thing, displaying a popover is another.
Since the OP keeps asking for propositions, in spite of having already several examples, why not add one ?[/quote]
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,