# Add SCompoundWidget to UUserWidget

**URL:** <https://forums.unrealengine.com/t/add-scompoundwidget-to-uuserwidget/373388>\
**Category:** UI\
**Tags:** unreal-engine, slate, Widget, CPP, Blueprint, question, UMG\
**Created:** [October 15, 2016, 6:58am UTC](https://forums.unrealengine.com/t/add-scompoundwidget-to-uuserwidget/373388 "2016-10-15T06:58:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_d4efcd70](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d4efcd70](https://forums.unrealengine.com/u/anonymous_user_d4efcd70)\
**Post date:** [October 15, 2016, 6:58am UTC](https://forums.unrealengine.com/t/add-scompoundwidget-to-uuserwidget/373388/1 "2016-10-15T06:58:11Z")

</div>

I have a UMG widget I setup so the artist can move elements around and change the look of the UI, and I’m using Slate to add text to the UI dynamically when needed, and hopefully cache commonly used variables. I’m successfully able to find the desired element of the `UUserWidget`, but I can’t figure out how to convert my `SCompoundWidget` to a `UWidget`.

```
void UCollectiblesUI::AddItemToUI(FText ItemName)
{
	ItemToAdd = ItemName;
	if(UVerticalBox *vb = Cast<UVerticalBox>(GetWidgetFromName("VerticalBox_196")))
	{
		TSharedPtr<SItemName> i = SNew(SItemName).textName(ItemToAdd);
		vb->AddChild(Cast<UWidget>(&i));
	}
}

```

How would I go about converting an `SCompoundWidget` to a `UWidget`?

---

<div class="post-metadata">

**Author:** ![Chris528](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chris528](https://forums.unrealengine.com/u/Chris528)\
**Post date:** [October 15, 2016, 9:57am UTC](https://forums.unrealengine.com/t/add-scompoundwidget-to-uuserwidget/373388/2 "2016-10-15T09:57:23Z")

</div>

Just wrap your SCompoundWidget with a UWidget, and use that.
