--- a/MenuView.st Sat Apr 27 20:13:37 1996 +0200
+++ b/MenuView.st Sat Apr 27 20:21:37 1996 +0200
@@ -95,6 +95,11 @@
[author:]
Claus Gittinger
+
+ [see also:]
+ PopUpMenu PullDownMenu
+ ClickMenuView
+ LineMenu PatternMenu
"
!
@@ -106,7 +111,7 @@
Notice: normally, menuviews are wrapped into either a popup-
menu or pulldown-menu. But they can also be used stand-alone
as in:
-
+ [exBegin]
|m|
m := MenuView
labels:#('foo'
@@ -118,6 +123,7 @@
#baz)
receiver:nil.
m open
+ [exEnd]
"
! !
@@ -889,16 +895,23 @@
indexOf:indexOrName
"return the index of the label named:aName or , if its a symbol
- the index in the selector list"
+ the index in the selector list.
+ If indexOrName is not a valid item, return 0."
indexOrName isSymbol ifTrue:[
- ^ selectors indexOf:indexOrName
+ ^ selectors indexOf:indexOrName
].
indexOrName isString ifTrue:[
- ^ list indexOf:indexOrName
+ ^ list indexOf:indexOrName
].
indexOrName isNil ifTrue:[^ 0].
+
+ (indexOrName respondsTo:#string) ifTrue:[
+ ^ list indexOf:indexOrName asString
+ ].
^ indexOrName
+
+ "Modified: 27.4.1996 / 15:25:16 / cg"
!
labelAt:indexOrName put:aString
@@ -1803,7 +1816,7 @@
performSelectedAction
|theSelector theAction isCheck checkOn val idx|
- superView isPopUpView ifTrue:[superView hide].
+ (superView notNil and:[superView isPopUpView]) ifTrue:[superView hide].
superMenu notNil ifTrue:[superMenu submenuTriggered].
idx := selection.
@@ -1916,7 +1929,7 @@
]
"Created: 4.3.1996 / 11:19:22 / cg"
- "Modified: 24.3.1996 / 17:16:58 / cg"
+ "Modified: 27.4.1996 / 13:53:01 / cg"
!
recomputeSize
@@ -2434,5 +2447,5 @@
!MenuView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/MenuView.st,v 1.71 1996-04-25 17:30:53 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/MenuView.st,v 1.72 1996-04-27 18:21:37 cg Exp $'
! !