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.
print('root:', root.name, type(root))
def print_subviews(v, prefix):
print(prefix, v.name, type(v))
for sv in v.subviews:
That will print something like
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...
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
I wrote a script that converts the pyui attributes into text for copying into a py file as code. I will take a bit of manipulation to convert over some of the attributes, but it should help get you started. The code is available here.