[core] PushButton attribute implemented

Add PushButtonParam class and implement onAttributeClicked method
This commit is contained in:
Aurore LAFAURIE 2024-04-24 15:29:08 +02:00
parent 6791f02f2d
commit eb1a0faf97
3 changed files with 31 additions and 0 deletions

View file

@ -892,6 +892,19 @@ class BaseNode(BaseObject):
if callable(m):
m(self)
def onAttributeClicked(self, attr):
""" When an attribute is clicked, a specific function can be defined in the descriptor and be called.
Args:
attr (Attribute): attribute that has been clicked
"""
paramName = attr.name[:1].upper() + attr.name[1:]
methodName = f'on{paramName}Clicked'
if hasattr(self.nodeDesc, methodName):
m = getattr(self.nodeDesc, methodName)
if callable(m):
m(self)
def updateInternals(self, cacheDir=None):
""" Update Node's internal parameters and output attributes.