Hello,
It seems that the juce::PopupMenu
can’t appear at the very bottom of the screen on MacOS (tested with Juce 6.0.8 and 6.1.0 - not tested on Windows and Linux), the menu is shifted by a few pixels to the top.
In this example, the juce::PopupMenu
is attached to the juce::TextButton
“Click Me” positioned at the bottom left corner of the window.
The window is not close to the bottom of the screen:
The window is close to the bottom of the screen:
Code:
MainComponent::MainComponent()
{
button.onClick = [&]()
{
juce::PopupMenu menu;
menu.addItem ("Item 1", nullptr);
menu.addItem ("Item 2", nullptr);
menu.showMenuAsync(juce::PopupMenu::Options().withTargetComponent (button));
};
addAndMakeVisible (button);
setSize (600, 400);
}
void MainComponent::resized()
{
button.setBounds (getLocalBounds().removeFromBottom (20).removeFromLeft (80));
}