# How can I implement a multiline Text editor using Slate?

**URL:** <https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576>\
**Category:** UI\
**Tags:** editable, text, unreal-engine, slate, question\
**Created:** [April 25, 2014, 9:38am UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576 "2014-04-25T09:38:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_02c81a731](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_02c81a731](https://forums.unrealengine.com/u/anonymous_user_02c81a731)\
**Post date:** [April 25, 2014, 9:38am UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/1 "2014-04-25T09:38:53Z")

</div>

I’m looking to add a multiline text editor into one of my projects.

Problem is, I’ve been through all the SEditableTextBox and variants and none seem to allow multi line editing.

They seem to only allow single line edits and the enter key submits the response. (Even if you paste some text with \r\n inside it it seems to get trimmed out).

Is there any way to disable this and allow multiline edits?

---

<div class="post-metadata">

**Author:** ![Jamie\_Dale](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jamie_dale/32/1165413_2.png) [@Jamie\_Dale](https://forums.unrealengine.com/u/Jamie_Dale)\
**Post date:** [April 25, 2014, 9:41am UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/2 "2014-04-25T09:41:25Z")

</div>

Have you seen SMultiLineEditableText?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_02c81a731](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_02c81a731](https://forums.unrealengine.com/u/anonymous_user_02c81a731)\
**Post date:** [April 25, 2014, 11:38am UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/3 "2014-04-25T11:38:36Z")

</div>

That does seem to do the trick for the multiline strings. It doesn’t seem editable though. Looking at the source, it’s missing the TypeChar function stuff set in SEditableText:

```
void SMultiLineEditableText::TypeChar( const int32 Character )
{
}

```

It only seems to be used in STestSuite.cpp at the moment, and isn’t editable. Am I missing some way to override the function?

---

<div class="post-metadata">

**Author:** ![Jamie\_Dale](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jamie_dale/32/1165413_2.png) [@Jamie\_Dale](https://forums.unrealengine.com/u/Jamie_Dale)\
**Post date:** [April 25, 2014, 11:49am UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/4 "2014-04-25T11:49:38Z")

</div>

Oh ☹

I’ll be honest, our multi-line text editing support has received very little love.

Do you feel confident enough about implementing that function for SMultiLineEditableText (I can’t imagine it will be too different from SEditableText). If you do, that’s great! If not, I’ll raise a bug about it internally.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_02c81a731](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_02c81a731](https://forums.unrealengine.com/u/anonymous_user_02c81a731)\
**Post date:** [April 25, 2014, 12:00pm UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/5 "2014-04-25T12:00:24Z")

</div>

Yeah - I should be fine to implement it. Thanks for your help in tracking down that class though.

---

<div class="post-metadata">

**Author:** ![Jamie\_Dale](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jamie_dale/32/1165413_2.png) [@Jamie\_Dale](https://forums.unrealengine.com/u/Jamie_Dale)\
**Post date:** [April 25, 2014, 12:07pm UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/6 "2014-04-25T12:07:54Z")

</div>

Cool, if you get it working then a pull request for the change would be awesome 🙂

It looks like most of the functions that handle actual text editing are currently stubbed out (more than just TypeChar), so it should hopefully just be a case of implementing them based on SEditableText.

---

<div class="post-metadata">

**Author:** ![Jamie\_Dale](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jamie_dale/32/1165413_2.png) [@Jamie\_Dale](https://forums.unrealengine.com/u/Jamie_Dale)\
**Post date:** [May 28, 2014, 11:33am UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/7 "2014-05-28T11:33:51Z")

</div>

Just to let you know (and I wasn’t aware of this at the time), but someone at Epic has been working on adding a multi-line text edit control to Slate.

They’ve now passed this work over to me to finish off, so hopefully we should have a working (although admittedly basic at this point) multi-line text edit control for 4.3 (we just need to make sure it hasn’t caused any regressions).

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 28, 2014, 2:55pm UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/8 "2014-05-28T14:55:13Z")

</div>

oooh wow, that sounds exciting Jamie!

I look forward to playing with it once you are done with it!

#❤

Rama

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_02c81a731](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_02c81a731](https://forums.unrealengine.com/u/anonymous_user_02c81a731)\
**Post date:** [May 28, 2014, 4:41pm UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/9 "2014-05-28T16:41:59Z")

</div>

Awesome stuff - looking forward to typing \n in \n Unreal \n 🙂

---

<div class="post-metadata">

**Author:** ![SRombauts](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SRombauts](https://forums.unrealengine.com/u/SRombauts)\
**Post date:** [May 30, 2014, 6:48am UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/10 "2014-05-30T06:48:31Z")

</div>

I will look at it as soon as possible in preview

---

<div class="post-metadata">

**Author:** ![beau.casey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@beau.casey](https://forums.unrealengine.com/u/beau.casey)\
**Post date:** [June 3, 2015, 3:30pm UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/11 "2015-06-03T15:30:27Z")

</div>

hazzah, the new [SMultiLineEditableText](https://github.com/EpicGames/UnrealEngine/blob/c9f4efe690de8b3b72a11223865c623ca0ee7086/Engine/Source/Runtime/Slate/Private/Widgets/Text/SMultiLineEditableText.cpp) has arrived!

---

<div class="post-metadata">

**Author:** ![labidus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@labidus](https://forums.unrealengine.com/u/labidus)\
**Post date:** [September 27, 2015, 1:47pm UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/12 "2015-09-27T13:47:29Z")

</div>

I use SMultiLineEditableText right now but the scrollbar is not working.

They are not show, even if I put my own VScrollbar, i traced the code and the problem seam related that they are not in a SMultiLineEditableText child, they exists but not draw since they are not really linked to the main widgets…

---

<div class="post-metadata">

**Author:** ![Jamie\_Dale](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jamie_dale/32/1165413_2.png) [@Jamie\_Dale](https://forums.unrealengine.com/u/Jamie_Dale)\
**Post date:** [September 28, 2015, 11:02am UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/13 "2015-09-28T11:02:52Z")

</div>

How have you set-up the scrollbars? Please feel free to open a new AnswerHub question for this, and we can discuss it there 🙂

---

<div class="post-metadata">

**Author:** ![labidus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@labidus](https://forums.unrealengine.com/u/labidus)\
**Post date:** [September 28, 2015, 4:00pm UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/14 "2015-09-28T16:00:19Z")

</div>

its a bug, i was not able to make it work since the control is not finished, sound like they forget to complete the scrollbar section

it will scroll its just they are not rendered

---

<div class="post-metadata">

**Author:** ![Jamie\_Dale](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jamie_dale/32/1165413_2.png) [@Jamie\_Dale](https://forums.unrealengine.com/u/Jamie_Dale)\
**Post date:** [September 28, 2015, 4:06pm UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/15 "2015-09-28T16:06:37Z")

</div>

`SMultiLineEditableTextBox` uses the `HScrollBar` and `VScrollBar` on `SMultiLineEditableText` to handle its scrollbars, so it does work (see `SMultiLineEditableTextBox::Construct`).

How have you set-up your scrollbars? You are responsible for actually adding them to the layout, the `HScrollBar` and `VScrollBar` are just handles to the scroll bars that get updated as the text content is changed.

---

<div class="post-metadata">

**Author:** ![labidus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@labidus](https://forums.unrealengine.com/u/labidus)\
**Post date:** [September 28, 2015, 4:11pm UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/16 "2015-09-28T16:11:34Z")

</div>

I traced in the code, the scrollbar don’t exists on screen, they are not rendered, they work but they are not rendered…

The control is not finished, a lot of stuff related to scrollbar are just not working, the paddingscrollbar stuff are in the control and are not used…

---

<div class="post-metadata">

**Author:** ![labidus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@labidus](https://forums.unrealengine.com/u/labidus)\
**Post date:** [September 28, 2015, 4:12pm UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/17 "2015-09-28T16:12:29Z")

</div>

well with 4.9.1 i mean, i did not check they other version

---

<div class="post-metadata">

**Author:** ![Jamie\_Dale](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jamie_dale/32/1165413_2.png) [@Jamie\_Dale](https://forums.unrealengine.com/u/Jamie_Dale)\
**Post date:** [September 28, 2015, 4:27pm UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/18 "2015-09-28T16:27:32Z")

</div>

So you’ve added your scrollbars to your widget layout somewhere? As I said before, `SMultiLineEditableText` will not do this for you, and neither will `SMultiLineEditableTextBox` if you provide custom scrollbars (as it’s assumed you want to place them at a custom location).

`SMultiLineEditableText` can appear to scroll even without having actual scrollbars.

The scrollbar padding is only used when `SMultiLineEditableTextBox` generates its own scrollbars, as it has no control over where your custom ones will be added.

---

<div class="post-metadata">

**Author:** ![labidus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@labidus](https://forums.unrealengine.com/u/labidus)\
**Post date:** [September 28, 2015, 4:42pm UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/19 "2015-09-28T16:42:09Z")

</div>

ok now I understand why nothing is show lol

I will need to add mine in the background somewhere using a scrollbox? or I need to handle all manually?

this control in my opinion should handle scrollbar better then this

---

<div class="post-metadata">

**Author:** ![labidus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@labidus](https://forums.unrealengine.com/u/labidus)\
**Post date:** [September 28, 2015, 4:44pm UTC](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576/20 "2015-09-28T16:44:21Z")

</div>

in my opinion its not intuitive to work like this. i wasted so many time with this control just for the scrollbar… and no document explain how it work

[Next page](https://forums.unrealengine.com/t/how-can-i-implement-a-multiline-text-editor-using-slate/281576.md?page=2)
