Hi,
Is there a way I can access Class A's function inside Class B?
My case scenario is Class A is a treeview layout. Class B is the main GeDialog.
You can see it here: https://www.dropbox.com/s/zua8k8xi8zw05g6/c4d263_access_class_a_function_inside_class_b.jpg?dl=0
I want Class B's refresh_layout
function to trigger when I changed a variable in the treeview layout specifically the global variable folder
. Is this possible?
A mock code would be something like this
class A(c4d.gui.TreeViewFunction):
def Select(self, root, userdata, obj, mode):
if mode == c4d.SELECTION_NEW:
for node in self.node_list :
node.selected = False
if node == obj:
node.selected = True
folder = obj.name
# Trigger Class B's refresh layout() function
class B (gui.GeDialog):
def InitValues():
global folder
def refresh_layout():
# refreshes Class B's layout
The other alternative would be to make the refresh_layout
function live outside the class but since the function has already a lot of variables using Class B
, I want it to be inside Class B
too.
Is this possible?