mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
PopupMenu: Update the example docs
This commit is contained in:
parent
74c8963880
commit
48a7274b08
1 changed files with 17 additions and 17 deletions
|
|
@ -39,20 +39,22 @@ namespace juce
|
|||
m.addItem (1, "item 1");
|
||||
m.addItem (2, "item 2");
|
||||
|
||||
const int result = m.show();
|
||||
|
||||
if (result == 0)
|
||||
{
|
||||
// user dismissed the menu without picking anything
|
||||
}
|
||||
else if (result == 1)
|
||||
{
|
||||
// user picked item 1
|
||||
}
|
||||
else if (result == 2)
|
||||
{
|
||||
// user picked item 2
|
||||
}
|
||||
m.showMenuAsync (PopupMenu::Options(),
|
||||
[] (int result)
|
||||
{
|
||||
if (result == 0)
|
||||
{
|
||||
// user dismissed the menu without picking anything
|
||||
}
|
||||
else if (result == 1)
|
||||
{
|
||||
// user picked item 1
|
||||
}
|
||||
else if (result == 2)
|
||||
{
|
||||
// user picked item 2
|
||||
}
|
||||
});
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
|
@ -68,9 +70,7 @@ namespace juce
|
|||
mainMenu.addItem (3, "item 3");
|
||||
mainMenu.addSubMenu ("other choices", subMenu);
|
||||
|
||||
const int result = m.show();
|
||||
|
||||
...etc
|
||||
m.showMenuAsync (...);
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue