# How to raise an iconified TGMainWindow

**URL:** <https://root-forum.cern.ch/t/how-to-raise-an-iconified-tgmainwindow/50467>\
**Category:** ROOT\
**Tags:** gui\
**Created:** [June 18, 2022, 9:10am UTC](https://root-forum.cern.ch/t/how-to-raise-an-iconified-tgmainwindow/50467 "2022-06-18T09:10:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![giovinazzo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/g/8baadc/32.png) [@giovinazzo](https://root-forum.cern.ch/u/giovinazzo)\
**Post date:** [June 18, 2022, 9:10am UTC](https://root-forum.cern.ch/t/how-to-raise-an-iconified-tgmainwindow/50467/1 "2022-06-18T09:10:22Z")

</div>

Hi,  
I designed an interface with several main windows (based on `TGMainWindow`).  
I would like to know if it is possible, when one of the window is iconified, to make it show up from code functions ?

I tried different finctions, without success: `RaiseWindow()`, `SetWMState()`…

I did not find anything else in the documentation.

Thank you for any suggestion.  
Jérôme

* * *

_ROOT Version:_ 6.xx  
_Platform:_ CentOS7  
_Compiler:_ g++

* * *

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [June 18, 2022, 10:02am UTC](https://root-forum.cern.ch/t/how-to-raise-an-iconified-tgmainwindow/50467/2 "2022-06-18T10:02:20Z")

</div>

Try MapRaised() [TGWindow::MapRaised()](https://root.cern/doc/master/classTGWindow.html#a36ee61ab02f5f93e4498a75a8cf047a9)

---

<div class="post-metadata">

**Author:** ![giovinazzo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/g/8baadc/32.png) [@giovinazzo](https://root-forum.cern.ch/u/giovinazzo)\
**Post date:** [June 18, 2022, 12:01pm UTC](https://root-forum.cern.ch/t/how-to-raise-an-iconified-tgmainwindow/50467/3 "2022-06-18T12:01:05Z")

</div>

Thanks a lot.  
Actually, this works if the window is first unmapped, otherwise not.  
In addition, to get it back at its previous position, the following code seems to do the job:

> ```
> Int_t x, y;
> myWindow->GetWMPosition(x,y);
> myWindow->UnmapWindow();
> myWindow->SetWMPosition(x,y);
> myWindow->MapRaised();
> 
> ```

Thank you very much.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [July 2, 2022, 12:02pm UTC](https://root-forum.cern.ch/t/how-to-raise-an-iconified-tgmainwindow/50467/4 "2022-07-02T12:02:05Z")

</div>

Closed on July 2, 2022, 12:02pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
