From 116113eb0247f90933503e5956860f5f7c3b6cf8 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 24 Jun 2021 14:27:31 +0800 Subject: [PATCH] bugfix --- kivyblocks/tree.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kivyblocks/tree.py b/kivyblocks/tree.py index c12340b..9dbae75 100644 --- a/kivyblocks/tree.py +++ b/kivyblocks/tree.py @@ -593,6 +593,16 @@ class MenuTree(TextTree): f = getRegisterFunctionByName(rfname) if f: 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):