MenuItem.st
changeset 4216 91c9929f64e8
parent 4168 0656fd9bc4b2
child 4217 b08e4ff220d7
--- a/MenuItem.st	Thu Dec 06 04:35:51 2018 +0000
+++ b/MenuItem.st	Thu Dec 27 16:19:39 2018 +0100
@@ -76,11 +76,23 @@
 label:aString
     "create and return a new menuItem, given a label string"
 
-    ^ self new
+    ^ (self new)
         label:aString;
         yourself
 
     "Created: / 14-08-1998 / 19:19:14 / cg"
+    "Modified (format): / 27-12-2018 / 16:21:01 / Claus Gittinger"
+!
+
+label:labelString argument:messageArg
+    "create and return a new menuItem, given its label and value
+     and an argument to be passed with the action"
+
+    ^ (self new)
+        label:labelString argument:messageArg;
+        yourself
+
+    "Created: / 27-12-2018 / 16:19:35 / Claus Gittinger"
 !
 
 label:labelString choice:choiceAspect choiceValue:selectorOrValue
@@ -109,11 +121,11 @@
      and an argument to be passed with the action"
 
     ^ (self new)
-        label:labelString;
-        itemValue:selectorOrValue argument:messageArg;
+        label:labelString itemValue:selectorOrValue argument:messageArg;
         yourself
 
     "Created: / 09-09-2012 / 13:22:31 / cg"
+    "Modified: / 27-12-2018 / 16:19:57 / Claus Gittinger"
 !
 
 label:labelString itemValue:selectorOrValue enabled:enabledHolder
@@ -122,18 +134,21 @@
      a block or a selector (to be sent to the application)"
 
     ^ (self new)
-        label:labelString itemValue:selectorOrValue enabled:enabledHolder
+        label:labelString itemValue:selectorOrValue enabled:enabledHolder;
+        yourself
 
     "Created: / 09-09-2012 / 13:23:05 / cg"
+    "Modified: / 27-12-2018 / 16:20:23 / Claus Gittinger"
 !
 
 label:labelString itemValue:selectorOrValue translateLabel:translateLabel
     "create and return a new menuItem, given its label, value and translateLabel flag"
 
     ^ (self new)
-        label:labelString
-        itemValue:selectorOrValue
-        translateLabel:translateLabel
+        label:labelString itemValue:selectorOrValue translateLabel:translateLabel;
+        yourself
+
+    "Modified: / 27-12-2018 / 16:20:34 / Claus Gittinger"
 !
 
 label:labelString submenuChannel:aSymbolOrValueHolder
@@ -205,11 +220,12 @@
 separator:sepString
     "create and return a new menuItem for a separator"
 
-    ^ self new
+    ^ (self new)
         label:sepString; translateLabel:false;
         yourself
 
     "Created: / 19-07-2017 / 09:17:21 / cg"
+    "Modified (format): / 27-12-2018 / 16:21:13 / Claus Gittinger"
 ! !
 
 !MenuItem class methodsFor:'class initialization'!
@@ -491,6 +507,13 @@
     "Created: / 09-09-2012 / 13:05:14 / cg"
 !
 
+label:labelString argument:someArgument
+    label := labelString.
+    argument := someArgument.
+
+    "Created: / 27-12-2018 / 16:19:14 / Claus Gittinger"
+!
+
 label:aString icon:anImage
     self label:aString.
     self resourceRetriever: (ResourceRetriever icon:anImage string:'')