# Screen flash when the mouse move to the module

**URL:** <https://discourse.slicer.org/t/screen-flash-when-the-mouse-move-to-the-module/10107>\
**Category:** Development\
**Created:** [February 4, 2020, 3:30pm UTC](https://discourse.slicer.org/t/screen-flash-when-the-mouse-move-to-the-module/10107 "2020-02-04T15:30:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)\
**Post date:** [February 4, 2020, 3:30pm UTC](https://discourse.slicer.org/t/screen-flash-when-the-mouse-move-to-the-module/10107/1 "2020-02-04T15:30:50Z")

</div>

Screen flash when the mouse move to the module.

 ![841ak-z5ra2 (2)](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/7/57ff302be7c238b4c332deec4b2cbc8511eafaee.gif)

```
class testWidget(object):

```

def **init** (self, parent = None):

```
if not parent:
  self.parent = slicer.qMRMLWidget()
  self.parent.setLayout(qt.QVBoxLayout())
  self.parent.setMRMLScene(slicer.mrmlScene)
else:
  self.parent = parent
self.layout = self.parent.layout()
if not parent:
  self.setup()
  self.parent.show()

```

def setup(self):  
# Instantiate and connect widgets …

```
#
#
# Parameters Area
#
parametersCollapsibleButton = ctk.ctkCollapsibleButton()
parametersCollapsibleButton.text = "Parameters"
self.layout.addWidget(parametersCollapsibleButton)
parametersFormLayout = qt.QFormLayout(parametersCollapsibleButton)

```

---

<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 4, 2020, 4:31pm UTC](https://discourse.slicer.org/t/screen-flash-when-the-mouse-move-to-the-module/10107/2 "2020-02-04T16:31:12Z")

</div>

This happens because there is nothing the module GUI that would constrain the width of the panel, so the panel is resized to the minimum necessary. The minimum size depends only on “Data Probe” panel content (at the bottom), which is changing when you move over/away from a slice view.

At some point, we’ll rework the Data Probe panel to have more robust size policy, but until then you can fix this by setting a suitable size policy in widgets in your module (e.g., set preferred or minimum size for the button).
