Bevel Button menu

I got a situation here, where I want to dynamically change the items shown in a bevel button’s menu.

In certain condition I want to display Item X and Item Z in the menu and in other condition I want to display Item B and Item C.

The problem this brings is that on action event I can’t figure out which item the user has chosen… Item 1 could be X, or B… depending on the context…

Is there an easy workaround like getting the text from the selected menu item ?

Thanks in advance.


Thanks Julian.