summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scene/gui/tree.cpp1
-rw-r--r--scene/gui/tree.h4
2 files changed, 5 insertions, 0 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 0049b54f50..3d0756337b 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -4174,6 +4174,7 @@ void Tree::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_column_title_language", "column"), &Tree::get_column_title_language);
ClassDB::bind_method(D_METHOD("get_scroll"), &Tree::get_scroll);
+ ClassDB::bind_method(D_METHOD("scroll_to_item", "item"), &Tree::_scroll_to_item);
ClassDB::bind_method(D_METHOD("set_hide_folding", "hide"), &Tree::set_hide_folding);
ClassDB::bind_method(D_METHOD("is_folding_hidden"), &Tree::is_folding_hidden);
diff --git a/scene/gui/tree.h b/scene/gui/tree.h
index 2136bada0b..854b82ebd7 100644
--- a/scene/gui/tree.h
+++ b/scene/gui/tree.h
@@ -564,6 +564,10 @@ protected:
return get_item_rect(Object::cast_to<TreeItem>(p_item), p_column);
}
+ void _scroll_to_item(Object *p_item) {
+ scroll_to_item(Object::cast_to<TreeItem>(p_item));
+ }
+
public:
virtual String get_tooltip(const Point2 &p_pos) const override;