Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Create an event handler for a cell that evaluates whenever editing has stopped
ResourceFunction["SetIdleEventHandler"][cell,code] evaluates code whenever editing stops in the given cell. | |
ResourceFunction["SetIdleEventHandler"][cell,{active,idle}] evaluates active whenever edits are made and evaluates idle a short time after editing has stopped. | |
ResourceFunction["SetIdleEventHandler"][cell,code,delay] waits delay seconds after editing to consider the cell idle. |
Evaluate code when typing stops in a cell:
In[1]:= |
Edit this text and see the color change
In[2]:= |
Edit this text
Set a value while editing is active:
In[3]:= |
Out[3]= |
Edit this text
Count edits made to a cell:
In[4]:= |
Out[4]= |
Edit this text and watch the counter values change
Show an icon while a cell is being modified:
In[5]:= |
Edit this text
Create an input cell that automatically evaluates five seconds after typing stops:
In[6]:= |
In[7]:= |
Out[7]= |
Use on a CellObject:
In[8]:= |
Out[8]= |
In[9]:= |
In[10]:= |
Out[10]= |
Create a notebook that automatically analyzes code when and input cell becomes idle:
In[11]:= |
In[12]:= |
Out[12]= |
SetIdleEventHandler uses CellDynamicExpression to track changes and will overwrite the existing setting if it exists:
In[13]:= |
Out[13]= |
SetIdleEventHandler will not work if notebook history tracking is disabled:
In[14]:= |
Edit this text
This work is licensed under a Creative Commons Attribution 4.0 International License