Menu.st
changeset 2584 5b5c3dda9a4b
parent 2494 994b030ae562
child 2751 d0729d604864
--- a/Menu.st	Sat Dec 13 11:39:21 2008 +0100
+++ b/Menu.st	Wed Dec 17 14:40:12 2008 +0100
@@ -270,9 +270,11 @@
 !
 
 lastItem
-    "returns last item
-    "
-    ^ items notNil ifTrue:[items last] ifFalse:[nil]
+    "returns the last item or nil, if there are none"
+
+    ^ items isEmptyOrNil 
+        ifTrue:[nil]
+        ifFalse:[items last]
 !
 
 lines
@@ -1018,6 +1020,12 @@
     "Modified: / 27.10.1997 / 15:12:44 / cg"
 !
 
+hasItems
+    "test whether there are any menu-items"
+
+    ^ items notEmptyOrNil
+!
+
 hasSubMenuAt:anIndex
     "test whether the menu item at the given index has a submenu
     "
@@ -1165,5 +1173,5 @@
 !Menu class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/Menu.st,v 1.70 2008-06-05 17:13:20 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/Menu.st,v 1.71 2008-12-17 13:40:12 cg Exp $'
 ! !