# Adding Widgets to Layout

**URL:** https://discourse.slicer.org/t/adding-widgets-to-layout/2074
**Category:** Development
**Created:** [February 12, 2018, 7:38pm UTC](https://discourse.slicer.org/t/adding-widgets-to-layout/2074 "2018-02-12T19:38:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![asheu](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@asheu](https://discourse.slicer.org/u/asheu)
#### Post date: [February 12, 2018, 7:38pm UTC](https://discourse.slicer.org/t/adding-widgets-to-layout/2074/1 "2018-02-12T19:38:28Z")

</div>

Hi there,

I am a fairly new to the game in terms of Slicer module development so would like some help. Right now, I am trying to add a LR slider widget onto the main window. Ideally, I would want this slider to interact with the reformat widget (i.e. allow me to move the individual slice at different angles). Are there any steps that I can go about into implementing this?

Thanks a lot!

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [February 12, 2018, 8:29pm UTC](https://discourse.slicer.org/t/adding-widgets-to-layout/2074/2 "2018-02-12T20:29:27Z")

</div>

Usually we would suggest putting functionality like that into a custom scripted module with it’s own interface panel as described here:

[https://www.slicer.org/wiki/Documentation/4.8/Training#Developing\_and\_contributing\_extensions\_for\_3D\_Slicer](https://www.slicer.org/wiki/Documentation/4.8/Training#Developing_and_contributing_extensions_for_3D_Slicer)

If you really need your widget in the main layout it’s of course possible to child widgets to any of the layouts but it would be more likely to break in the future.

---

<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: [February 12, 2018, 10:20pm UTC](https://discourse.slicer.org/t/adding-widgets-to-layout/2074/3 "2018-02-12T22:20:11Z")

</div>

Here is a module that does this, except that it rotates slice using a slider instead of translating it. It is a scripted module so it should be easy to modify it do what you need:

> **[SlicerHeart/ValveView at master · SlicerHeart/SlicerHeart](https://github.com/SlicerHeart/SlicerHeart/tree/master/ValveView)**
>
> master/ValveView
