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

Grids of dynamic objects responding to mouseovers seem to be quite slow in general, for instance:

  Mouseover[Framed[" ", Background -> Blue], 
   Framed[" ", Background -> White]], {i, 50}, {j, 50}], 
 Spacings -> {0, 0}]

How can this lagging be avoided?

share|improve this question
It seems reasonably fast to me; how much lag are you seeing? – Mr.Wizard May 28 '12 at 8:05
About a second, but If you increase the size of the grid it gets worse fast. – M.R. May 28 '12 at 8:09
Okay, if I make the grid bigger, e.g. 150x150 I see the lag. What is your application for this many Mouseovers? Perhaps there is a faster approach. – Mr.Wizard May 28 '12 at 8:12
What platform as you on? Linux? On a fairly outdated Windows machine I can highlight about 6-8 cells per second. – Szabolcs May 28 '12 at 8:21
I had similar problems: I wanted the user to be able to click on a grid. Solved the problem by having just one click event and determining the bin from the mouse coordinates manually. – Ajasja May 28 '12 at 13:17

I think the problem is not the Mouseover itself, but with the redrawing of the Framed elements.

This, for example, is much faster:

  Mouseover[Style[" ", Background -> Blue], 
            Style[" ", Background -> White]], {i, 50}, {j, 50}], Spacings -> 2,
  Frame -> All]
share|improve this answer

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.