Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.8K Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

school - how to make a "button" with parenthesis

Posted 12 years ago

Hello, I have a school subject Mathematica. I have this code. Could I ask, how do I make the numbers? The numbers will be written into the frame A.

Thank you for the advice :)

DynamicModule[{a = 0, b = 0}, 
Deploy[Style[
    Panel[Grid[
      Transpose[{{Style["A", Red], Style["B", Red], 
         "here is their sum", "their difference", 
         "their product"}, {InputField[Dynamic[a], Number], 
         InputField[Dynamic[b], Number], 
         InputField[Dynamic[a + b], Enabled -> False], 
         InputField[Dynamic[a - b], Enabled -> False], 
         InputField[Dynamic[a b], Enabled -> False]}}], 
      Alignment -> Right], ImageMargins -> 10], 
    DefaultOptions -> {InputField -> {ContinuousAction -> True, 
        FieldSize -> {{5, 30}, {1, Infinity}}}}]]

  Row@Prepend[
    Table[With[{b = b}, 
      Button[b, predpisFce = predpisFce <> b, Alignment -> Center, 
       Appearance -> "Pressed"]], {b, {"1", "2", "3", "4", "5", "6", 
       "7", "8", "9", "0"}}], 
    Style["Cisla             ", Italic, Bold]]
]
Attachments:
POSTED BY: martin martin
5 Replies

thank you :)

POSTED BY: martin martin
POSTED BY: David Reiss

I downloaded a couple of hours in the school commands. "predpisFce 's got nothing to do. But I do not know how to do: Press the "1-9" and appear to me to frame A. That is my problem. I do not know how to program :(

POSTED BY: martin martin

I am not sure what your row of buttons is supposed to do since predpisFce is not defined and does not appear anywhere other than in the button and it is not initialized as a local variable in the DynamicModule.

POSTED BY: David Reiss
POSTED BY: martin martin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard