How do I get a button to use the kernel?
 The processor of the ButtonFunction option is determined by the ButtonEvaluator option. The default for ButtonEvaluator is None, which allows only commands that the front end can execute. If you need the kernel to evaluate the ButtonFunction, you need to set ButtonEvaluator to Automatic, Local, or the name of the kernel listed in the menu item You will also need to set Active→True for the ButtonBox or the Cell which contains the ButtonBox. Another issue to consider is that the output of a ButtonFunction is not directed into your notebook, while side effects are. This means that the following button... In[1]:= |  |
...will generate the graphic (which is a side effect) but not the output cell. And the following button... In[2]:= |  |
...has no side effect, so no cell is generated. To get the output in your notebook, you need to use a function which generates a cell. In[3]:= |  |
Download this FAQ as a Mathematica 5.2 Notebook
Questions or comments? Send email to support@wolfram.com.
|