From 13fb24cb6f9ebabb7097aad05550a406022b4c92 Mon Sep 17 00:00:00 2001 From: Jummit Date: Tue, 3 Nov 2020 21:08:05 +0100 Subject: [PATCH] expose edit_selected in Tree --- doc/classes/Tree.xml | 7 +++++++ scene/gui/tree.cpp | 1 + 2 files changed, 8 insertions(+) diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 73575b43096..d186142d86c 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -48,6 +48,13 @@ The new item will be the [code]idx[/code]th child of parent, or it will be the last child if there are not enough siblings. + + + + + Edits the selected tree item as if it was clicked. The item must be set editable with [method TreeItem.set_editable]. Returns [code]true[/code] if the item could be edited. Fails if no item is selected. + + diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 31030765e0a..6bdc5a1aa0a 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -3813,6 +3813,7 @@ void Tree::_bind_methods() { ClassDB::bind_method(D_METHOD("get_edited"), &Tree::get_edited); ClassDB::bind_method(D_METHOD("get_edited_column"), &Tree::get_edited_column); + ClassDB::bind_method(D_METHOD("edit_selected"), &Tree::edit_selected); ClassDB::bind_method(D_METHOD("get_custom_popup_rect"), &Tree::get_custom_popup_rect); ClassDB::bind_method(D_METHOD("get_item_area_rect", "item", "column"), &Tree::_get_item_rect, DEFVAL(-1)); ClassDB::bind_method(D_METHOD("get_item_at_position", "position"), &Tree::get_item_at_position);