From cdbc3e57e70888ca245061fdbc3a4dc09e7aa59c Mon Sep 17 00:00:00 2001
From: Rene Sepulveda <errissa@gmail.com>
Date: Fri, 13 Oct 2023 15:30:43 -0400
Subject: [PATCH] Add pybind to get Widget from ItemId

---
 cpp/pybind/visualization/gui/gui.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/cpp/pybind/visualization/gui/gui.cpp b/cpp/pybind/visualization/gui/gui.cpp
index ed8484c6176..8fc9e333f30 100644
--- a/cpp/pybind/visualization/gui/gui.cpp
+++ b/cpp/pybind/visualization/gui/gui.cpp
@@ -1550,6 +1550,11 @@ void pybind_gui_classes(py::module &m) {
             .def("remove_item", &TreeView::RemoveItem,
                  "Removes an item and all its children (if any)")
             .def("clear", &TreeView::Clear, "Removes all items")
+            .def("get_item", &TreeView::GetItem,
+                 "Returns the widget associated with the provided Item ID. For "
+                 "example, to manipulate the widget of the currently selected "
+                 "item you would use the ItemID of the selected_item property "
+                 "with get_item to get the widget.")
             .def_property(
                     "can_select_items_with_children",
                     &TreeView::GetCanSelectItemsWithChildren,