Use of .OnCheckStateChanged of SCheckBox

Hi all

I’m trying to follow this previous answer as an example use of .OnCheckStateChanged - UI - Epic Developer Community Forums , but I cannot get the .OnCheckStateChanged delegate to work in the same way. And I’m wondering if it’s changed in any way over the past 2yrs!

I’ve also been looking at STestSuite.cpp and SWidgetGallery.cpp for examples but I don’t how mine is any different.

I only get the build error:

no instance of overloaded function "SCheckBox::FArguments::OnCheckStateChanged" matches the argument list	VASFVPluginProject
argument types are: (FVASFVPluginEdModeToolkit *, void (Locals::*)(ECheckBoxState CheckState))
object type is: SCheckBox::FArguments

I’m writing an editor plugin in c++ soo all my UI work is done with slate c++ rather than UMG. So far I have my widgets set up correctly and everything works until I add in the .OnCheckStateChanged attribute for a checkbox as below.

In the UI:

    SNew(SCheckBox)
    .OnCheckStateChanged(this, &Locals::OnVisCheckStateChanged)

and earlier in a struct in the same .cpp file

struct Locals
{
    void OnVisCheckStateChanged(ECheckBoxState CheckState)
		{
			UE_LOG(VASFVLog, Warning, TEXT("Visibility Check State: TBC"));
		}

As you can see it’s not meant to do anything fancy yet, I just want to test that I can detect the checkstate change.

Any help would be greatly appreciated!

I’ve now used in the .cpp file

SNew(SCheckBox)
.OnCheckStateChanged_Raw(this, &FVASFVPluginEdModeToolkit::ConnectionVisibilityChanged)

and later the function,

void FVASFVPluginEdModeToolkit::ConnectionVisibilityChanged(ECheckBoxState newState)
{
	...
}