Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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? – Mike Honeychurch Dec 28 '12 at 1:23
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? – Jens Dec 28 '12 at 5:16
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). – Michael Stern Dec 28 '12 at 13:04
up vote 6 down vote accepted

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

share|improve this answer
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?) – Michael Stern Dec 28 '12 at 0:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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