another dynamic menu example
authorca
Sat, 02 Mar 1996 12:23:13 +0100
changeset 459 5c35e2f02d27
parent 458 14e994e20eb5
child 460 3a981ebd72b2
another dynamic menu example
PopUpMenu.st
--- a/PopUpMenu.st	Sat Mar 02 00:05:45 1996 +0100
+++ b/PopUpMenu.st	Sat Mar 02 12:23:13 1996 +0100
@@ -76,6 +76,17 @@
         p showAtPointer
 
 
+    dynamic with action instead of selector being sent:
+        |p|
+
+        p := PopUpMenu
+                labels:(($a to: $d) collect:[:char | char asString])
+                selectors:nil
+                receiver:nil.
+        p action:[:idx | Transcript showCr:'selected index is '; showCr:idx].
+        p showAtPointer
+
+
     sometimes, you want to specify both selectors and some arguments
     to be sent; this is done by:
 
@@ -1063,5 +1074,5 @@
 !PopUpMenu class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/PopUpMenu.st,v 1.38 1996-02-28 18:46:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/PopUpMenu.st,v 1.39 1996-03-02 11:23:13 ca Exp $'
 ! !