Positioning a CallOutBox under a SystemTrayIconComponent

Hi,

I’m currently attempting to develop a task bar app (no desktop window or macOS dock icon - just a system tray icon that displays some sort of popup when clicked).

I’ve copied over the code from the DemoTaskBarComponent from the JUCE Demo and that all works fine, however I’m now trying to replace the PopupMenu with a CallOutBox.

The CallOutBox appears (using example code from the classes docs), however I’m struggling to figure out how to obtain the correct position values for ‘areaToPointTo’ so that the CallOutBox is drawn underneath the system tray icon.

Any ideas?

Thanks in advance.