Is it possible to create interactive code in Mathematica (via EventHandler[] or Manipulate[] perhaps) that continually updates some calculation based on external data in the time when no user input is received?

As a trivial example, code that shows the current time, with seconds, continually updating, and which allows the user to click on any of the numbers to change their color.

Thank you.

  • $\begingroup$ Michael when you refer to "external data in the time when no user input is received" could you mean scheduling an import of data from an external source at either a fixed time or regular intervals? $\endgroup$ Dec 28, 2012 at 1:23
  • $\begingroup$ Also have a look at Clock in the documentation. In fact, this question is quite unspecific. For example, do you want the updates to continue when the relevant cell is not being displayed on the screen? Dynamic doesn't permit that. What is it you're trying to achieve? What have you tried? $\endgroup$
    – Jens
    Dec 28, 2012 at 5:16
  • $\begingroup$ Responding to the first comment above -- yes, in practice, this will involve a scheduled import of third party data (actually, essentially continuous import of data that changes very frequently). $\endgroup$ Dec 28, 2012 at 13:04

1 Answer 1


Yes, it is possible. Have you read the tutorials about Dynamic? Here is a simple example of a continuously updated time which changes color on Mouseover


Here the slightly more complex example with two buttons.

    Button["Toggle Bold",bold=!bold],
    Button["Toogle Blue", blue=!blue],

Mathematica graphics

  • $\begingroup$ That is helpful. Can you show how to do it with buttons above the time, each representing a different action (say, a different color to change to time to when clicked?) $\endgroup$ Dec 28, 2012 at 0:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.