This commit is contained in:
yumoqing 2021-06-24 14:27:31 +08:00
parent f487db9c04
commit 116113eb02

View File

@ -593,6 +593,16 @@ class MenuTree(TextTree):
f = getRegisterFunctionByName(rfname) f = getRegisterFunctionByName(rfname)
if f: if f:
f(self,node.data) f(self,node.data)
return
script = node.data.get('script')
if script:
target_name = node.data.get('target', self.target)
target = Factory.Blocks.getWidgetById(target_name, self)
if target:
eval(script,{'self':target})
return
class PopupMenu(BoxLayout): class PopupMenu(BoxLayout):