Re: Buttons and Overwriting a Cell
- To: mathgroup at smc.vnet.net
- Subject: [mg105575] Re: [mg105545] Buttons and Overwriting a Cell
- From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
- Date: Wed, 9 Dec 2009 05:51:41 -0500 (EST)
Hello, Gregory, try this: Button["Hit Me", Module[{m}, Clear[m]; m = {{RandomInteger[{2, 12}], RandomInteger[{2, 12}]}, {RandomInteger[{2, 12}], RandomInteger[{2, 12}]}}; Print[TableForm[m, TableHeadings -> {Automatic, Automatic}]]]] Regards, Alexei Hello everyone, I'm trying to create a button that will produce a 2x2 table of random integers, which I think I've succeeded in doing with the following. Button["Hit Me", Print[TableForm[{{RandomInteger[{2,12}], RandomInteger[{2,12}]}, {RandomInteger[{2,12}], RandomInteger[{2,12}]}}, TableHeadings->{Automatic,Automatic}]]] I'd also like it to overwrite any existing table that it has produced on a previous click. I know I need to set CellAutoOverwrite to True, but I'm not sure how to work that into my Button statement. Any suggestions would be much appreciated. Regards, Gregory -- Alexei Boulbitch, Dr., habil. Senior Scientist IEE S.A. ZAE Weiergewan 11, rue Edmond Reuter L-5326 Contern Luxembourg Phone: +352 2454 2566 Fax: +352 2454 3566 Website: www.iee.lu This e-mail may contain trade secrets or privileged, undisclosed or otherwise confidential information. If you are not the intended recipient and have received this e-mail in error, you are hereby notified that any review, copying or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal from your system. Thank you for your co-operation.