From e076f60ed679b4d8d1f277a9bb2169656927c00b Mon Sep 17 00:00:00 2001 From: HP van Braam Date: Tue, 26 Nov 2024 13:19:56 +0100 Subject: [PATCH] Expose clear_buttons to ClassDB Since this function now exists there seems to be little reason not to expose it. Discussed with @bruvzg. --- doc/classes/TreeItem.xml | 6 ++++++ scene/gui/tree.cpp | 1 + 2 files changed, 7 insertions(+) diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index d04a6f7316db..e121782f9b10 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -36,6 +36,12 @@ Calls the [param method] on the actual TreeItem and its children recursively. Pass parameters as a comma separated list. + + + + Remove all buttons from the [TreeItem]. + + diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 63a4b334c452..54121f1e2fd2 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1778,6 +1778,7 @@ void TreeItem::_bind_methods() { ClassDB::bind_method(D_METHOD("set_custom_as_button", "column", "enable"), &TreeItem::set_custom_as_button); ClassDB::bind_method(D_METHOD("is_custom_set_as_button", "column"), &TreeItem::is_custom_set_as_button); + ClassDB::bind_method(D_METHOD("clear_buttons"), &TreeItem::clear_buttons); ClassDB::bind_method(D_METHOD("add_button", "column", "button", "id", "disabled", "tooltip_text"), &TreeItem::add_button, DEFVAL(-1), DEFVAL(false), DEFVAL("")); ClassDB::bind_method(D_METHOD("get_button_count", "column"), &TreeItem::get_button_count); ClassDB::bind_method(D_METHOD("get_button_tooltip_text", "column", "button_index"), &TreeItem::get_button_tooltip_text);