Finding Who Popped up a Menu
- Last UpdatedNov 12, 2025
- 1 minute read
-
Use the following method to find out whether a menu was popped up from a gadget, and if so, the gadget’s name:
!menu.popupGadget() is GADGET
If the menu was a popup on a gadget then the returned GADGET variable is a reference to the gadget. If the menu was popped up from a pulldown-menu or from a popup on the form itself, the value is UNSET.
Example:
!g = !menu.popupGadget()
if !g.set() then
!n = !g.name()
$p menu popped up by gadget $!n
else
!n = menu.owner().name()
$p menu popped up by form $!n
endif