Skip to main content

dynamic - Dynamically show usage



As the title states I would like to dynamically show ::usage on several functions.


Let's consider two functions here:


funlist={Plot,Plot3D};

Thus I do:


Input[
Panel[
PopupMenu[Dynamic@whichfun, funlist], "usage should be here"],
Dynamic@whichfun]


Instead of "usage should be here" I obviously tried (Dynamic@whichfun)::usage but it's complaining that the Head is not a Symbol, so I tried to convert it to a Symbol but it still fails.


Thus the question is:


How can I convert Dynamic@whichfun in order to be able to have its usage?



Answer



This is the problem with evaluation, since MessageName is HoldFirst. You can use e.g.


Dynamic[MessageName @@ {whichfun, "usage"}]

or


Dynamic @ MessageName[Evaluate[whichfun], "usage"]


in place of "usage should be here".


Comments