Download

SEditableTextBox, .OnTextCommitted will not build.

I have a slate window, and am trying to store and call the value from a Editable text box.

My code is:

.h


void OnTextChanged(const FText& InText, ETextCommit::Type);

.cpp


SNew(SEditableTextBox)
.Text(FText::FromString("5"))
.OnTextCommitted(this, &FtoolSetModule::OnTextChanged)


FText MyText;

void FtoolSetModule::OnTextChanged(const FText& InText, ETextCommit::Type)
{
	MyText = InText;

}

When i try to build this, I get:


Severity	Code	Description	Project	File	Line
Error	C2039	'AsShared': is not a member of 'FtoolSetModule'

This seems like it should be fine, what am i doing wrong here?

Thanks!

Ah, solved. This was because the class i was in was not a Slate class.

I have this working by changing:

.OnTextCommitted

to

.OnTextCommitted_Raw