Re: Button Question?
- To: mathgroup at smc.vnet.net
- Subject: [mg84606] Re: Button Question?
- From: Norbert Marxer <marxer at mec.li>
- Date: Sun, 6 Jan 2008 06:00:51 -0500 (EST)
- References: <flnj3b$jmk$1@smc.vnet.net>
On 5 Jan., 10:36, John <j... at lehigh.edu> wrote: > Evaluation of the cell listed below prints a button, but clicking on > the button does not print the random numbers. Why is ButtonEvaluator, > not mispelled, printed in red? > > Error message says a =A0button function option is not a rule. > > Cell[ButtonBox["Simulate", Active -> True, > =A0 =A0ButtonFunction -> (Needs["MultivariateStatistics`"]; > =A0 =A0 =A0Print[RandomInteger[ > =A0 =A0 =A0 =A0MultivariateStatistics`MultinomialDistribution[ > =A0 =A0 =A0 =A0 100, {1/6, 1/6, 1/6, 1/6, 1/6, 1/6}], 1]]), > =A0 =A0ButtonEvaluator -> Automatic] // DisplayForm, "Output"], > > I want the button to work as advertised, but so far no luck. > > John Hello All you have to do is to use RuleDelayed: i.e. replace ButtonFunction -> ... by ButtonFunction :> ... This works for me. Best Regards Norbert Marxer