fixed addMenuItem
authorClaus Gittinger <cg@exept.de>
Fri, 03 Feb 2006 11:33:58 +0100
changeset 6522 271558921414
parent 6521 6f55c8f06c1f
child 6523 4dd07bbf1726
fixed addMenuItem
NewLauncher.st
--- a/NewLauncher.st	Fri Feb 03 11:01:17 2006 +0100
+++ b/NewLauncher.st	Fri Feb 03 11:33:58 2006 +0100
@@ -3377,7 +3377,7 @@
             rest := subMenuPath copyFrom:2.
             menuPanel := subMenu := item submenu.
 
-            subMenuPath do:[:pathComponent|
+            rest do:[:pathComponent|
                 subMenu notNil ifTrue:[
                     menuPanel := subMenu.
                     subItem := subMenu itemAt:pathComponent.
@@ -3388,6 +3388,9 @@
                     ]
                 ].
             ].
+            subMenu notNil ifTrue:[
+                menuPanel := subMenu.
+            ]
         ].
 
         "/ look if not already in the panel
@@ -3395,14 +3398,18 @@
             "item already exists - do nothing"
             ^ self.
         ].
-        "/ ok, not there; search for the position to put the item
+
+        "/ ok, search for the position to put the item
 
         freeMenuIndex := 0.
         itemNameOrNil notNil ifTrue:[
             freeMenuIndex := menuPanel findFirst:[:i| i nameKey = itemNameOrNil].
             freeMenuIndex == 0 ifTrue:[
-                freeMenuIndex := menuPanel findFirst:[:i| i activeHelpKey = itemNameOrNil 
-                                                          or:[i label = itemNameOrNil]].
+                freeMenuIndex := menuPanel findFirst:[:i| i itemValue = itemNameOrNil].
+                freeMenuIndex == 0 ifTrue:[
+                    freeMenuIndex := menuPanel findFirst:[:i| i activeHelpKey = itemNameOrNil 
+                                                              or:[i label = itemNameOrNil]].
+                ]
             ]
         ].
         freeMenuIndex == 0 ifTrue:[
@@ -4173,5 +4180,5 @@
 !NewLauncher class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/NewLauncher.st,v 1.333 2006-01-31 23:31:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/NewLauncher.st,v 1.334 2006-02-03 10:33:58 cg Exp $'
 ! !