Here is the bit of code causing me issues:
{DynamicModule[{nothing},
EventHandler[
ActionMenu["Set x", {"x = 1" :> (x = 1;)}, Enabled -> True],
{"MouseClicked" :> (nothing++)}]], Dynamic[x]}
No matter how hard I try to click the ActionMenu does not open at all.
Removing the {"MouseClicked" :> (nothing++)} allows to open the ActionMenu:
{DynamicModule[{nothing},
EventHandler[
ActionMenu["Set x", {"x = 1" :> (x = 1;)}, Enabled -> True],
{}]], Dynamic[x]}
The aim of the code would be to Enable/Disable the ActionMenu after x = 1 is clicked in this example.
What am I doing wrong in the first bit of code?
DynamicModule[{x}, {EventHandler[ ActionMenu["Set x", {"x = 1" :> (x = 1;)}, Enabled -> Dynamic[x =!= 1]]], Dynamic[x]}]Simple, but not sure if this is what you want – Dr. belisarius Dec 22 '13 at 18:01