ActiveHelp.st
changeset 634 1d88f55984a2
parent 633 5d162347fac8
child 636 446b52f2c603
--- a/ActiveHelp.st	Sat Jun 28 14:06:53 1997 +0200
+++ b/ActiveHelp.st	Sat Jun 28 14:13:17 1997 +0200
@@ -436,29 +436,6 @@
     "Modified: 28.5.1996 / 20:18:28 / cg"
 !
 
-initiateHelpFor:aView atX:x y:y
-    "start a timeout process to display help for aView after some delay"
-
-    |text p|
-
-    text := self helpTextFor:aView atX:x y:y.
-
-    text notNil ifTrue:[
-        DelayTime > 0 ifTrue:[
-            self stopHelpDisplayProcess.
-            showProcess := [
-                    Delay waitForSeconds:DelayTime.
-                    showProcess := nil.
-                    self showHelp:text for:aView
-            ] forkAt:(Processor userSchedulingPriority + 1).
-        ] ifFalse:[
-            self showHelp:text for:aView
-        ]
-    ].
-
-    "Modified: 28.6.1997 / 14:05:33 / cg"
-!
-
 stopHelpDisplayProcess
     |p|
 
@@ -495,6 +472,43 @@
     "Modified: 28.6.1997 / 14:03:50 / cg"
 !
 
+initiateHelpFor:aView atX:x y:y
+    "ask aView for helpText, passing x/y coordinates;
+     start a timeout process to display this helpText after some delay;
+     Normally used internally, but can also be used by widgets to force 
+     re-negotiation of the displayed helpText 
+     (for example in a menu, when the selection changes)"
+
+    |text p|
+
+    text := self helpTextFor:aView atX:x y:y.
+
+    text notNil ifTrue:[
+        DelayTime > 0 ifTrue:[
+            self stopHelpDisplayProcess.
+            showProcess := [
+                    Delay waitForSeconds:DelayTime.
+                    showProcess := nil.
+                    self showHelp:text for:aView
+            ] forkAt:(Processor userSchedulingPriority + 1).
+        ] ifFalse:[
+            self showHelp:text for:aView
+        ]
+    ].
+
+    "
+     can be used in a widget as:
+
+        ActiveHelp isActive ifTrue:[
+            ActiveHelp currentHelpListener
+                initiateHelpFor:self atX:x y:y
+            ]
+        ]
+    "
+
+    "Modified: 28.6.1997 / 14:13:10 / cg"
+!
+
 showHelp:aHelpText for:view
     "show the help text for aView"
 
@@ -573,6 +587,6 @@
 !ActiveHelp class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/ActiveHelp.st,v 1.22 1997-06-28 12:06:53 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/ActiveHelp.st,v 1.23 1997-06-28 12:13:17 cg Exp $'
 ! !
 ActiveHelp initialize!