class: Menu stable
authorClaus Gittinger <cg@exept.de>
Thu, 12 Sep 2013 11:30:17 +0200
changeset 3245 5dd413dddd1c
parent 3244 259f8530131a
child 3246 d167d433053c
class: Menu changed: #asOldStylePopUpMenuFor: fix for menuItems with a block as itemValue
Menu.st
--- a/Menu.st	Thu Sep 12 10:30:38 2013 +0200
+++ b/Menu.st	Thu Sep 12 11:30:17 2013 +0200
@@ -790,7 +790,20 @@
         ].
     ].
 
-    menuView actions:(itemsShown collect:[:each | [ receiver perform:each value ]]).
+    menuView actions:(itemsShown
+                        collect:[:each |
+                            [ 
+                                |actionOrSymbol|
+
+                                actionOrSymbol := each itemValue.
+                                actionOrSymbol isBlock ifTrue:[
+                                    actionOrSymbol value
+                                ] ifFalse:[
+                                    receiver perform:actionOrSymbol 
+                                ]
+                            ]
+                        ]
+                      ).
 
     ^ PopUpMenu forMenu:menuView
 
@@ -1275,6 +1288,6 @@
 !Menu class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview2/Menu.st,v 1.89 2013-09-01 15:46:21 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/Menu.st,v 1.90 2013-09-12 09:30:17 cg Exp $'
 ! !