You’re looking for an Event Dispatcher. A native button already has one (more than one, actually). For a menu that creates a pop-up prompt that reports back to its creator, you could hook it up like so:
Above, the OK | CANCEL are the buttons. You can add a more complex dispatcher to the prompt widget, one that sends actual data, too.