Controller.st
changeset 125 d74e6ab7157a
parent 123 9f8c7f20fdb2
child 127 98b0725782bd
--- a/Controller.st	Sat Mar 25 23:17:13 1995 +0100
+++ b/Controller.st	Sun Mar 26 22:14:10 1995 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1992 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libview/Controller.st,v 1.14 1995-03-25 22:12:01 claus Exp $
+$Header: /cvs/stx/stx/libview/Controller.st,v 1.15 1995-03-26 20:11:51 claus Exp $
 '!
 
 !Controller class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview/Controller.st,v 1.14 1995-03-25 22:12:01 claus Exp $
+$Header: /cvs/stx/stx/libview/Controller.st,v 1.15 1995-03-26 20:11:51 claus Exp $
 "
 !
 
@@ -146,6 +146,10 @@
 
 menuHolder 
     ^ nil
+!
+
+menuPerformer 
+    ^ nil
 ! !
 
 !Controller methodsFor:'event handling'!
@@ -161,10 +165,17 @@
     "actually, this should be called 'middleButtonActivity'.
      But for ST-80 compatibility ...."
 
-    |sym menu actionSelector menuHolder|
+    |sym menu actionSelector menuHolder menuPerformer|
 
     (menuHolder := self menuHolder) notNil ifTrue:[
 	self halt.
+    ] ifFalse:[
+	menuHolder := model
+    ].
+    (menuPerformer := self menuPerformer) notNil ifTrue:[
+	self halt.
+    ] ifFalse:[
+	menuPerformer := model
     ].
 
     "
@@ -172,13 +183,13 @@
      if there is a model, and a menuSymbol is defined,
      ask model for the menu and launch that if non-nil.
     "
-    (model notNil 
+    (menuHolder notNil 
     and:[(sym := view menuSymbol) notNil
     and:[sym isSymbol]]) ifTrue:[
 	"
 	 ask model for the menu
 	"
-	menu := model perform:sym.
+	menu := menuHolder perform:sym.
 	menu notNil ifTrue:[
 	    "
 	     got one, launch the menu. It is supposed
@@ -187,11 +198,14 @@
 	    actionSelector := menu startUp.
 	    (actionSelector notNil
 	    and:[actionSelector isSymbol]) ifTrue:[
-		model perform:actionSelector
+		menuPerformer perform:actionSelector
 	    ]
 	].
 	^ self
     ].
+    "
+     ST/X style static menus - going to be obsoleted ...
+    "
     (menu := view middleButtonMenu) notNil ifTrue:[
 	menu showAtPointer
     ]