# How to handle slider in the slicer widget

**URL:** <https://discourse.slicer.org/t/how-to-handle-slider-in-the-slicer-widget/37790>\
**Category:** Development\
**Created:** [August 9, 2024, 4:28am UTC](https://discourse.slicer.org/t/how-to-handle-slider-in-the-slicer-widget/37790 "2024-08-09T04:28:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maniron](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@maniron](https://discourse.slicer.org/u/maniron)\
**Post date:** [August 9, 2024, 4:28am UTC](https://discourse.slicer.org/t/how-to-handle-slider-in-the-slicer-widget/37790/1 "2024-08-09T04:28:00Z")

</div>

Hi,

I want to do an operation when ever there is a change in the value of the slider in the red widget

---

<div class="post-metadata">

**Author:** ![maniron](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@maniron](https://discourse.slicer.org/u/maniron)\
**Post date:** [August 27, 2024, 10:14am UTC](https://discourse.slicer.org/t/how-to-handle-slider-in-the-slicer-widget/37790/2 "2024-08-27T10:14:18Z")

</div>

Hi I am trying to handle sequence browser frame slider , I found a way to get the index, but I want to connect a function when the slider value changes how can I achieve it

> sequenceBrowserNode = slicer.mrmlScene.GetFirstNodeByClass(“vtkMRMLSequenceBrowserNode”)  
> if sequenceBrowserNode:  
> sequenceBrowserNode.AddObserver(sequenceBrowserNode.ModifiedEvent, self.onFrameChanged)

this was the method I used Kindly help me out as

---

<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:** [September 12, 2024, 3:25am UTC](https://discourse.slicer.org/t/how-to-handle-slider-in-the-slicer-widget/37790/3 "2024-09-12T03:25:29Z")

</div>

You can add an observer to the sequence browser MRML node that calls your python function whenever the node is modified.
