# How run function after clicking botton in plugin

**URL:** <https://forums.unrealengine.com/t/how-run-function-after-clicking-botton-in-plugin/375701>\
**Category:** Plugins\
**Tags:** button, unreal-engine, onclicked, functions, Plugins, question\
**Created:** [November 7, 2016, 8:28pm UTC](https://forums.unrealengine.com/t/how-run-function-after-clicking-botton-in-plugin/375701 "2016-11-07T20:28:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zzzlor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zzzlor](https://forums.unrealengine.com/u/zzzlor)\
**Post date:** [November 7, 2016, 8:28pm UTC](https://forums.unrealengine.com/t/how-run-function-after-clicking-botton-in-plugin/375701/1 "2016-11-07T20:28:49Z")

</div>

**Hi!**

I’m trying to create a _plugin._ But I don’t know much about it.  
While training I face a problem. **I can’t use the function after clicking the button.**

**I used this template:**

 ![114140-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/c/77c485a2da6302e452331214f551790ae26cfb3c.png)

**ModularBuild.h**

```
class FModularBuildModule : public IModuleInterface
{
public:
	FModularBuildModule();
	//UFUNCTION()
	FReply TestS();

```

**ModularBuild.cpp**

```
      [...]

TSharedRef<SDockTab> FModularBuildModule::OnSpawnPluginTab(const FSpawnTabArgs& SpawnTabArgs)
{

	return SNew(SDockTab).TabRole(ETabRole::NomadTab)
		[
			// Put your tab content here!
			SNew(SBox)
			.HAlign(HAlign_Center)
			.VAlign(VAlign_Center)
			[
				SNew(SButton)
				.Text(FText::FromString(TEXT("Push")))
				.ContentPadding(3)
				.OnClicked(this, &FModularBuildModule::TestS)
			]
		];
}

      [...]

FReply FModularBuildModule::TestS()
{
	UE_LOG(LogTemp, Log, TEXT("It win"));
	return FReply::Handled();
}

```

**Error** :  
[Error\_txt][2] or

```
 1>g:\programs\epic games\4.13\engine\source\runtime\core\public\delegates\DelegateSignatureImpl.INL(181): error c2039: total: is not a member of "FModularBuildModule"
    1> G:\Programs\DeadMind\DeadMind\Plugins\ModularBuild\Source\ModularBuild\Public\ModularBuild.h(13) note: see the announcement "FModularBuildModule"
    1> G:\Programs\Epic Games\4.13\Engine\Source\Environment\Slate\Public\Widgets\Input\SButton.h(54): note: see reference to instantiation of a function template at compile "TBaseDelegate<FReply> TBaseDelegate<FReply>::CreateSP<Userclass,>(Userclass *,FReply (__cdecl FModularBuildModule::* )(void))"
    1> 
    1> [
    1> Userclass=FModularBuildModule
    1> ]
    1> G:\Programs\Epic Games\4.13\Engine\Source\Environment\Slate\Public\Widgets\Input\SButton.h(54): note: see reference to instantiation of a function template at compile "TBaseDelegate<FReply> TBaseDelegate<FReply>::CreateSP<Userclass,>(Userclass *,FReply (__cdecl FModularBuildModule::* )(void))"
    1> 
    1> [
    1> Userclass=FModularBuildModule
    1> ]
    1> G:\Programs\DeadMind\DeadMind\Plugins\ModularBuild\Source\ModularBuild\Private\ModularBuild.cpp(78): note: see reference to instantiation of a function template at compile "SButton::FArguments::WidgetArgsType &SButton::FArguments::OnClicked<FModularBuildModule>(Userclass *,FReply (__cdecl FModularBuildModule::* )(void))"
    1> 
    1> [
    1> Userclass=FModularBuildModule
    1> ]
    1>error : UBT error : failed to produce item: G:\Programs\DeadMind\DeadMind\Plugins\ModularBuild\Binaries\Win64\UE4Editor-ModularBuild-5456.dll
    1> Total build time: 88,75 seconds
    1>files c:\program (x86)\msbuild\Microsoft.CPP\V4.0\V140\Microsoft.The makefile.Targets(37,5): MSB3075 error: Output of command ""G:\Programs\Epic game engine\\4.13\build\\BatchFiles to build.bat" DeadMindEditor Win64 development "G:\Programs\DeadMind\DeadMind\DeadMind.uproject" -waitmutex"
```

---

<div class="post-metadata">

**Author:** ![zzzlor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zzzlor](https://forums.unrealengine.com/u/zzzlor)\
**Post date:** [November 7, 2016, 9:47pm UTC](https://forums.unrealengine.com/t/how-run-function-after-clicking-botton-in-plugin/375701/2 "2016-11-07T21:47:55Z")

</div>

If someone has this error too - Read here [link text](https://forums.unrealengine.com/showthread.php?128103-Run-function-after-clicking-the-button-in-the-plugin-PROBLEM)

Alas, I was faced with another problem. My project has crashed. Any help would be appreciated!
