Editing a range in TreeItem

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

Hi I’m using the Tree control on a vm toy I’m writting, the idea is that users can edit a range using the keyboard and press enter to move to the lower cell. Right now I’m setting it up with:

	item.set_text_align(col, TreeItem.ALIGN_RIGHT)
	item.set_editable(col, true)
	item.set_cell_mode(col, TreeItem.CELL_MODE_RANGE)
	item.set_range(col, neander.mem[i])
	item.set_range_config(col, 0, 255, 1, false)

But that only allows you to edit the cell with the up/down arrows. Is there a way to get the same behaviour we have on godot inspector, where on clicking on the item it becomes a text edit box?

:bust_in_silhouette: Reply From: Leonardo Santagada

The answer is that it only works on trees that have select mode set to “single”. I had mine set to “row”.

Its not perfectly the behaviour I wanted, but it will work for now.