Skip to content

Commit

Permalink
Expose clear_buttons to ClassDB
Browse files Browse the repository at this point in the history
Since this function now exists there seems to be little reason not to
expose it. Discussed with @bruvzg.
  • Loading branch information
hpvb committed Dec 2, 2024
1 parent 5bec696 commit 22b2b64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/classes/TreeItem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
Calls the [param method] on the actual TreeItem and its children recursively. Pass parameters as a comma separated list.
</description>
</method>
<method name="clear_buttons">
<return type="void" />
<description>
Removes all buttons from all columns of this item.
</description>
</method>
<method name="clear_custom_bg_color">
<return type="void" />
<param index="0" name="column" type="int" />
Expand Down
1 change: 1 addition & 0 deletions scene/gui/tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 22b2b64

Please sign in to comment.