How to implement TextEdit in a TreeItem column

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By tim_e

In the Inspector, for example, there is a multiline TextEdit TreeItem field for “Editor Description”, etc. in the Tree object.

How do you enable the multiline TextEdit type instead of the default LineEdit?

With thanks…

:bust_in_silhouette: Reply From: NewUser2000

The foldout in the Inspector is a VBoxContainer, so it can have any Control inside it. TreeItems are very limited in what they can contain and I don’t think they can have a TextEdit.

The documentation on TreeItems is really lacking. It would be really helpful to have some in-depth examples available.

Thanks for your response!

TreeItems are super flexible and are used for the editor Scene tree and FileSystem and most of the Inspector rows. Wherever there is a folddown caret, that’s in a Tree.

It also creates the section dividers in the Inspector where you have the blank row with an icon in the center.

Your response made me dig a bit further and indeed there are some BoxContainers that are within some Inspector sections, which seems to be a VBox containing a Tree (or another VBox) for each section - so that answers the question about how TextEdit is inside the Inspector.

tim_e | 2020-11-01 17:28

Wherever there is a folddown caret, that’s in a Tree.

Are you sure? I’m using the Editor Debugger from AssetLib to check the UI elements and foldouts are called EditorInspectorSection.

And the section dividers are EditorInspectorCategory.

NewUser2000 | 2020-11-01 21:00

Definitely - I can replicate the elements of the Inspector with only Tree/TreeItem except for TextEdit and perhaps a few others.

The sections and categories you mentioned are what I was describing as each being comprised of either a Tree or a VBox and Tree.

tim_e | 2020-11-01 22:06