# How can I update the contents of the warning window in Slicer?

**URL:** <https://discourse.slicer.org/t/how-can-i-update-the-contents-of-the-warning-window-in-slicer/32238>\
**Category:** Development\
**Created:** [October 16, 2023, 6:58am UTC](https://discourse.slicer.org/t/how-can-i-update-the-contents-of-the-warning-window-in-slicer/32238 "2023-10-16T06:58:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsa934](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dsa934/32/17907_2.png) [@dsa934](https://discourse.slicer.org/u/dsa934)\
**Post date:** [October 16, 2023, 6:58am UTC](https://discourse.slicer.org/t/how-can-i-update-the-contents-of-the-warning-window-in-slicer/32238/1 "2023-10-16T06:58:56Z")

</div>

Operating system:window 10  
Slicer version: 5.4

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/b/db193ca135ce671256349c066ffc4ef7bae44b13.png)

I made it to display a notification window via QtMessageBox when certain conditions are not met.

But how can I update a new alert window to an existing alert window without multiple alert windows appearing as shown above?

---

<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:** [October 16, 2023, 6:06pm UTC](https://discourse.slicer.org/t/how-can-i-update-the-contents-of-the-warning-window-in-slicer/32238/2 "2023-10-16T18:06:18Z")

</div>

You can modify properties of your messagebox object to change its text.

Note that this question is not specific to Slicer but in general about how to use Qt in Python. Bing Chat or ChatGPT should be able to answer these kind of generic questions accurately. You can even ask Slicer-specific questions, but those answers more often require some adjustments.

---

<div class="post-metadata">

**Author:** ![dsa934](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dsa934/32/17907_2.png) [@dsa934](https://discourse.slicer.org/u/dsa934)\
**Post date:** [October 16, 2023, 11:22pm UTC](https://discourse.slicer.org/t/how-can-i-update-the-contents-of-the-warning-window-in-slicer/32238/3 "2023-10-16T23:22:44Z")

</div>

To be precise, I am curious about the function to delete only the msgbox among the various objects rendered in the slicer window.

For example, the ‘slicer.mrmlScene.Clear()’ command deletes all objects in the slicer. Where can I find information about deleting only specific objects?

Ah, while I was replying, I suddenly remembered a method.

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [October 16, 2023, 11:43pm UTC](https://discourse.slicer.org/t/how-can-i-update-the-contents-of-the-warning-window-in-slicer/32238/4 "2023-10-16T23:43:36Z")

</div>

> [@dsa934](#):
>
> Ah, while I was replying, I suddenly remembered a method.

Please post here if what you remembered worked. Since this thread already exists, it can serve as future reference for someone running into the same issue as you.
