Ok, let's start very basic.
Your views start at the root view -- the one you call present on -- and then are heirarchical going down . If you assign a name in the UI editor, you can refer to a subview by name, a but only from it's immediate superview.
Please do the following:. From your button action, call this method on sender.
def print_view(sender):
root=sender
while root.superview:
root=root.superview
print('root:', root.name, type(root))
def print_subviews(v, prefix):
print(prefix, v.name, type(v))
for sv in v.subviews:
print_subviews(v, prefix+'+')
print_subviews(root,'')
That will print something like
root UI.View
+view1 UI.view
++button1 ui.Button
++textview1 UI.Textview
+label1 UI.LabelView
Etc. Hopefully this helps explain your view heirarchy.
Note that often people create global variables, or attributes in the root view that point to deep subviews...
root=ui.load_view (....)
root.input_box=root['view1']['textview1']
....
Then you can simply refer to these in your callbacks functions without having to use superview/subview business in your callbacks. If your button takes action on a specific item, that ends up being cleaner. If instead you have 5 buttons using the same action, then you would use sender. Superview