Interesting question!
So post_to_main_thread()
is a method that takes 3 arguments (inputs/variables) and returns None
.
Because it's a method (a function associated with a class, not just a standalone function) the first argument, self
, refers to the instance of the class that the function is part of.
The other two arguments are passed within the function parentheses, as expected with a standalone function. So a call might look like this:
instance_name = open3d.visualization.gui.Application(...)
instance_name.post_to_main_thread(arg1, arg2)
arg1
should be of type open3d::visualization::gui::Window
. This is an instance of the class open3d.visualization.gui.Window()
.
arg2
should be of type Callable()
. This describes a number of built-ins that you can find details about in the documentation. To quote:
The subscription syntax must always be used with exactly two values: the argument list and the return type. The argument list must be a list of types or an ellipsis; the return type must be a single type.
So in this case the type should be Callable[[], None]
, which means this should be a function that takes no input and returns None
. Carrying on from our previous example, you'd pass this as an argument like so:
def my_callable:
print('Hello, World!')
return
instance_name.post_to_main_thread(arg1, my_callable)
Does that clear things up?