MenuItem.st
changeset 1336 97d0a2cff0ac
parent 1333 423b4b4404c4
child 1347 e033db194238
--- a/MenuItem.st	Sat Feb 05 15:24:37 2000 +0100
+++ b/MenuItem.st	Sat Feb 05 16:44:45 2000 +0100
@@ -852,6 +852,19 @@
     shortcutKey := something.
 !
 
+staticSubmenu
+    "get the submenu or nil;
+     only returns the subMenu if its a static subMenu (i.e. not
+     provided by a valueHolder or block).
+    "
+    (submenu isValueModel or:[submenu isBlock]) ifTrue:[
+        ^ nil
+    ].
+    ^ submenu
+
+    "Modified: / 5.2.2000 / 16:49:54 / cg"
+!
+
 submenu
     "get the submenu or nil
     "
@@ -864,9 +877,20 @@
 submenu:something
     "set the submenu or nil
     "
-    submenu := something.
+    (something isValueModel or:[something isBlock]) ifTrue:[
+        submenuChannel notNil ifTrue:[
+            "/ programmers error ?
+            "/ how can I decide which one to use if there is both
+            "/ a channel and a subMenu ...
+            self halt:'overwriting submenuchannel'.
+        ].
+        submenuChannel := something
+    ] ifFalse:[
+        submenu := something.
+    ]
 
-    "Created: 25.2.1997 / 20:59:28 / cg"
+    "Created: / 25.2.1997 / 20:59:28 / cg"
+    "Modified: / 5.2.2000 / 16:53:28 / cg"
 !
 
 submenuChannel
@@ -893,5 +917,5 @@
 !MenuItem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/MenuItem.st,v 1.35 2000-02-05 13:39:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/MenuItem.st,v 1.36 2000-02-05 15:44:45 cg Exp $'
 ! !