# How to open an editor widget on plugin click

**URL:** <https://forums.unrealengine.com/t/how-to-open-an-editor-widget-on-plugin-click/458828>\
**Category:** UI\
**Tags:** editor-utility-widge, unreal-engine, editor, Widget, Blueprint, question, CPP\
**Created:** [November 25, 2019, 10:47pm UTC](https://forums.unrealengine.com/t/how-to-open-an-editor-widget-on-plugin-click/458828 "2019-11-25T22:47:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CorentinG78](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/corenting78/32/1109769_2.png) [@CorentinG78](https://forums.unrealengine.com/u/CorentinG78)\
**Post date:** [November 25, 2019, 10:47pm UTC](https://forums.unrealengine.com/t/how-to-open-an-editor-widget-on-plugin-click/458828/1 "2019-11-25T22:47:03Z")

</div>

Hi!

I’m working on a project and I would like to make my own plugin (with a button in the editor toolbar)

I have to open an editor widget, pretty simple right? But I’m really new in C++ and I can’t figure how to do this.

I only know that I have to put some code in here (it’s the UE example) :

```
void FTestToolbarbtnModule::PluginButtonClicked()
{
	// Put your "OnButtonClicked" stuff here
	FText DialogText = FText::Format(
							LOCTEXT("PluginButtonDialogText", "coucoucoucocuocuocuAdd code to {0} in {1} to override this button's actions coucou"),
							FText::FromString(TEXT("FTestToolbarbtnModule::PluginButtonClicked()")),
							FText::FromString(TEXT("TestToolbarbtn.cpp"))
					   );
	FMessageDialog::Open(EAppMsgType::Ok, DialogText);
}

```

Can you help me?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Tearwyn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tearwyn](https://forums.unrealengine.com/u/Tearwyn)\
**Post date:** [March 2, 2022, 2:06am UTC](https://forums.unrealengine.com/t/how-to-open-an-editor-widget-on-plugin-click/458828/2 "2022-03-02T02:06:15Z")

</div>

Hey, I’m having this same issue. I was wondering if you ever figured it out?

---

<div class="post-metadata">

**Author:** ![Vahab](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vahab/32/1148756_2.png) [@Vahab](https://forums.unrealengine.com/u/Vahab)\
**Post date:** [November 15, 2022, 11:04pm UTC](https://forums.unrealengine.com/t/how-to-open-an-editor-widget-on-plugin-click/458828/3 "2022-11-15T23:04:50Z")

</div>

Here is the solution: Load the editor utility blueprint first, then spawn and register it accordingly by UEditorUtilitySubsystem.SpawnAndRegisterTab

```auto
void FTestToolbarbtnModule::PluginButtonClicked() const
{
	UObject* WidgetObj = LoadObject<UObject>(nullptr, TEXT(" *Path of the Utility Widget*"));
	UEditorUtilityWidgetBlueprint* WidgetBP = static_cast<UEditorUtilityWidgetBlueprint*>(WidgetObj);
	UEditorUtilitySubsystem* EditorUtilitySubsystem = GEditor->GetEditorSubsystem<UEditorUtilitySubsystem>();
	EditorUtilitySubsystem->SpawnAndRegisterTab(WidgetBP);
}

```

---

<div class="post-metadata">

**Author:** ![virtualfilmer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/virtualfilmer/32/940767_2.png) [@virtualfilmer](https://forums.unrealengine.com/u/virtualfilmer)\
**Post date:** [May 22, 2024, 10:19pm UTC](https://forums.unrealengine.com/t/how-to-open-an-editor-widget-on-plugin-click/458828/4 "2024-05-22T22:19:14Z")

</div>

Thanks for posting this!

Two questions @Vahab if you can spare a moment? 🙂

1. Where should we actually put the Editor Utility Widget files? Do we move the “.uasset” files for the EUW into a path? That’s what I’ve been trying to do. I’ve moved them to here:  
{UNREALPROJECTNAME}\Plugins{pluginname}\Resources\EUW

2. When you say _PATH OF THE UTILITY WIDGET_, is that a relative path? and is it just a path to a folder that we should do - or a path and then a .uasset item?

I’ve tried many ways but can’t figure it out.

---

<div class="post-metadata">

**Author:** ![Vahab](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vahab/32/1148756_2.png) [@Vahab](https://forums.unrealengine.com/u/Vahab)\
**Post date:** [May 23, 2024, 8:43pm UTC](https://forums.unrealengine.com/t/how-to-open-an-editor-widget-on-plugin-click/458828/5 "2024-05-23T20:43:41Z")

</div>

The Editor Utility Widget could be anywhere, if it is in the main Content folder, the relative path should be started with  
` /Game/path of the utility widget`  
and if it is in your plugin folder, the path should be like this  
`/{PluginName}/path of the editor utility`

for example:  
`/MyPlugin/EditorUI/EUW_MyEditorWidget`

I am working on a new plugin that has a feature to do this without any CPP code, will be released soon!
