# My First Slate Window: Tree View that Reflects contents of Hard Drive, real time!

**URL:** <https://forums.unrealengine.com/t/my-first-slate-window-tree-view-that-reflects-contents-of-hard-drive-real-time/4235>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [May 12, 2014, 6:47pm UTC](https://forums.unrealengine.com/t/my-first-slate-window-tree-view-that-reflects-contents-of-hard-drive-real-time/4235 "2014-05-12T18:47:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 12, 2014, 6:47pm UTC](https://forums.unrealengine.com/t/my-first-slate-window-tree-view-that-reflects-contents-of-hard-drive-real-time/4235/1 "2014-05-12T18:47:22Z")

</div>

Dear Community,

Here I present to you my first Slate Window!

It reflects the contents of my hard drive, and auto updates itself as I make changes to my computer’s hard drive!

I used a Tree View widget to reflect the file structure for easy viewing and navigation.

Once the user clicks on a certain directory in the Slate window top portion, the file contents of all subdirectories are displayed in the lower portion!

The Slate window is light-weight and features my own unique Style 🙂

**Annnnnnnd**

**I am giving you the entire c++ code** for the foundation of what you see in the video, for your own unique implementation!

What took me the longest to figure out was all the basics, which I am giving you on the wiki page!

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/0/1/9018f00d7e74f3c61c56d4b855209c9cc5921e17.jpeg "MyFirstSlateWindow") ](https://www.youtube.com/watch?v=x40jXCy8dvk)

**Wiki Link to the C++ Code**

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

Enjoy!

---

<div class="post-metadata">

**Author:** ![VegasRich](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VegasRich](https://forums.unrealengine.com/u/VegasRich)\
**Post date:** [May 12, 2014, 9:28pm UTC](https://forums.unrealengine.com/t/my-first-slate-window-tree-view-that-reflects-contents-of-hard-drive-real-time/4235/2 "2014-05-12T21:28:53Z")

</div>

Handy for saved game files, custom icons/portraits, or other things. Very handy, thanks! You’re very industrious…

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 13, 2014, 1:28am UTC](https://forums.unrealengine.com/t/my-first-slate-window-tree-view-that-reflects-contents-of-hard-drive-real-time/4235/3 "2014-05-13T01:28:01Z")

</div>

> [@VegasRich;41415](#):
>
> Handy for saved game files, custom icons/portraits, or other things. Very handy, thanks! You’re very industrious…

Hee hee! Thanks VegasRich!

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 13, 2014, 5:49am UTC](https://forums.unrealengine.com/t/my-first-slate-window-tree-view-that-reflects-contents-of-hard-drive-real-time/4235/4 "2014-05-13T05:49:21Z")

</div>

> [@;41877](#):
>
> Good job , this will be useful to plenty of people.

Thanks !

And congrats on your awesome plugins! (see his signature 🙂 )

🙂

---

<div class="post-metadata">

**Author:** ![Andargor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Andargor](https://forums.unrealengine.com/u/Andargor)\
**Post date:** [May 16, 2014, 7:01pm UTC](https://forums.unrealengine.com/t/my-first-slate-window-tree-view-that-reflects-contents-of-hard-drive-real-time/4235/5 "2014-05-16T19:01:08Z")

</div>

, it is not evident from the video, but is your window a child of the viewport, or a separate pop-up window? I can do the latter with:

```auto

FSlateApplication::Get().AddWindow( SomeSWindowRef );

```

But I would like to know how to have the SWindow as a child of the viewport to keep it “inside” the game.

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 16, 2014, 10:29pm UTC](https://forums.unrealengine.com/t/my-first-slate-window-tree-view-that-reflects-contents-of-hard-drive-real-time/4235/6 "2014-05-16T22:29:18Z")

</div>

> [@dmacesic;48855](#):
>
> , it is not evident from the video, but is your window a child of the viewport, or a separate pop-up window? I can do the latter with:
> 
> ```auto
> 
> FSlateApplication::Get().AddWindow( SomeSWindowRef );
> 
> ```
> 
> But I would like to know how to have the SWindow as a child of the viewport to keep it “inside” the game.

To avoid having the issue where clicking outside the new window would cause it to disappear / be hidden in the layers of windows, I had to make it a “native child” of the current parent window

````auto

**Code Sample ~ Get Active Top Level Window**

I wrote this code to ensure that my new window was a native child of whatever the " **Active Top Level Window**" was:

```

	TSharedPtr<SWindow> TopWindow = FSlateApplication::Get().GetActiveTopLevelWindow();
	if(TopWindow.IsValid())
	{
		//Add as Native
		FSlateApplication::Get().AddWindowAsNativeChild(NewWindow, TopWindow.ToSharedRef(), true);
	}
	else
	{
	
		//Default in case no top window
		FSlateApplication::Get().AddWindow(NewWindow);
	}

```
````

---

<div class="post-metadata">

**Author:** ![Andargor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Andargor](https://forums.unrealengine.com/u/Andargor)\
**Post date:** [May 16, 2014, 11:14pm UTC](https://forums.unrealengine.com/t/my-first-slate-window-tree-view-that-reflects-contents-of-hard-drive-real-time/4235/7 "2014-05-16T23:14:57Z")

</div>

> [@;49116](#):
>
> To avoid having the issue where clicking outside the new window would cause it to disappear / be hidden in the layers of windows, I had to make it a “native child” of the current parent window

Solved my issue, thanks!

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 17, 2014, 1:06am UTC](https://forums.unrealengine.com/t/my-first-slate-window-tree-view-that-reflects-contents-of-hard-drive-real-time/4235/8 "2014-05-17T01:06:14Z")

</div>

> [@dmacesic;49176](#):
>
> Solved my issue, thanks!

Yaaay!

🙂

---

<div class="post-metadata">

**Author:** ![Syedhs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Syedhs](https://forums.unrealengine.com/u/Syedhs)\
**Post date:** [June 17, 2015, 8:05am UTC](https://forums.unrealengine.com/t/my-first-slate-window-tree-view-that-reflects-contents-of-hard-drive-real-time/4235/9 "2015-06-17T08:05:45Z")

</div>

,

From what I can gather (video, comments), this slate application does load a level which you extend class UnrealEdEngine. Can you please describe more about this - a full working source code would be a very nice start!

---

<div class="post-metadata">

**Author:** ![Anonymous\_c79aea4986fd726db6bff6714bf989a0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_c79aea4986fd726db6bff6714bf989a0](https://forums.unrealengine.com/u/Anonymous_c79aea4986fd726db6bff6714bf989a0)\
**Post date:** [November 12, 2019, 9:34am UTC](https://forums.unrealengine.com/t/my-first-slate-window-tree-view-that-reflects-contents-of-hard-drive-real-time/4235/10 "2019-11-12T09:34:53Z")

</div>

Thank you:)
