Create blocking popup in Blender api I'm writing an addon to import game models into Blender. But sometimes, there is a mismatch between a bone's name from the animation file and the name from the object file. 

So I'd like, when the script encounters an unknown bone, to open a popup with a list of existing bones (plus an option to ignore the bone), that would pause the script until the user has chosen his result, and to get back the chosen option. 

I've seen 
How to call invoke_popup?
to create a popup, but I'm stuck on several points :


how to call it from my python code
how to change its name (label) before calling it (to say for example "bone X not found")
how to get the result of the selection
how to get the user see and interact with the popup before the end of the script
Yes, Python can make a popup menu.

The options are either...


Create a popup on the fly. using bpy.context.window_manager.popup_menuhttp://www.blender.org/api/blender_python_api_2_75_release/bpy.types.WindowManager.html#bpy.types.WindowManager.popup_menu
Define a menu subclass of bpy.types.Menu, then call it. see:http://www.blender.org/api/blender_python_api_2_75_release/bpy.types.Menu.html


Both of the links above include examples.



Regarding "How to get the result of the selection", The way Blender works, menu items reference operators. So you would need to define an operator which is referenced from the menu.