# Run function after button clicked

**URL:** <https://discourse.slicer.org/t/run-function-after-button-clicked/7273>\
**Category:** Support\
**Created:** [June 21, 2019, 9:35am UTC](https://discourse.slicer.org/t/run-function-after-button-clicked/7273 "2019-06-21T09:35:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zapaishchykova](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/zapaishchykova/32/66121_2.png) [@zapaishchykova](https://discourse.slicer.org/u/zapaishchykova)\
**Post date:** [June 21, 2019, 9:35am UTC](https://discourse.slicer.org/t/run-function-after-button-clicked/7273/1 "2019-06-21T09:35:55Z")

</div>

Hi there!  
I am wondering if there is any functionality to track if the button on the UI was clicked? For example, I want to run a computation each time after fiducial is placed

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 21, 2019, 12:52pm UTC](https://discourse.slicer.org/t/run-function-after-button-clicked/7273/2 "2019-06-21T12:52:31Z")

</div>

You can automatically run computations when a node changed by adding an observer. See [PerkLab programming tutorials](https://www.slicer.org/wiki/Documentation/Nightly/Training#Tutorials_for_software_developers) for details and examples.
