Skip to content

Commit

Permalink
Add Missing Python Bindings and Add/Update Docstrings (#6429)
Browse files Browse the repository at this point in the history
* Add missing pybinds for manipulating object properties
* Add pybind to get Widget from ItemId
* Add argument annotations to Scene pybinds for documentation
* More rendering pybind docs for functions and args.
---------
Co-authored-by: Sameer Sheorey <[email protected]>
  • Loading branch information
errissa authored Dec 29, 2023
1 parent 846754b commit 7931263
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 97 deletions.
9 changes: 7 additions & 2 deletions cpp/pybind/visualization/gui/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -888,8 +888,8 @@ void pybind_gui_classes(py::module &m) {
.def_property_readonly("number_of_items",
&Combobox::GetNumberOfItems,
"The number of items (read-only)")
.def("get_item", &Combobox::GetItem,
"Returns the item at the given index")
.def("get_item", &Combobox::GetItem, "index"_a,
"Returns the item at the given index. Index must be valid.")
.def_property("selected_index", &Combobox::GetSelectedIndex,
&Combobox::SetSelectedIndex,
"The index of the currently selected item")
Expand Down Expand Up @@ -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, "item_id"_a,
"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,
Expand Down
Loading

0 comments on commit 7931263

Please sign in to comment.