ToolApplicationModel.st
changeset 984 a0a868c45691
parent 982 807f440e0df7
child 987 54c15a2642f6
--- a/ToolApplicationModel.st	Sat Jun 20 16:44:32 1998 +0200
+++ b/ToolApplicationModel.st	Sat Jun 20 16:48:01 1998 +0200
@@ -1077,6 +1077,16 @@
     ^''
 !
 
+doShowHelp:aHelpText
+    "displays aHelpText in the info label or if present detours it to its masterApplication"
+
+    aHelpText isNil 
+        ifTrue:  [self updateInfoLabel] 
+        ifFalse: [self valueOfInfoLabel value: (aHelpText asString printString readStream through: $.)].
+
+    "Created: / 20.6.1998 / 16:37:23 / cg"
+!
+
 openAbout
     "opens an about box"
 
@@ -1139,14 +1149,38 @@
 !
 
 showHelp:aHelpText for:view
-    "displays aHelpText in the info label or if present detours it to its masterApplication"
+    "displays aHelpText in the info label or if present detours it to its masterApplication.
+     Here, an event is pushed for myself to synchronize the helpDisplay
+     with event handling."
+
+    |wg mySensor|
 
     self showHelp ifFalse: [^true].
     masterApplication notNil ifTrue: [masterApplication showHelp: aHelpText for:view].
-    aHelpText isNil 
-        ifTrue:  [self updateInfoLabel] 
-        ifFalse: [self valueOfInfoLabel value: (aHelpText asString printString readStream through: $.)].
+
+"/ OLD: show it right here ...
+"/    aHelpText isNil 
+"/        ifTrue:  [self updateInfoLabel] 
+"/        ifFalse: [self valueOfInfoLabel value: (aHelpText asString printString readStream through: $.)].
+    "/ the nil-tests should not be req'd - but thats a last-minute
+    "/ change and I dont want to breaks the delivery ...
+
+"/ NEW: push it into the event queue, to have it displayed
+"/ syncronously with other events.
+"/ (also any errors are reported as occurring in my context;
+"/  instead of occurring in the activeHelp context).
+
+    (wg := self windowGroup) notNil ifTrue:[
+        mySensor := wg sensor.
+        mySensor notNil ifTrue:[
+            mySensor flushEventsFor:self withType:#doShowHelp:.
+            mySensor pushUserEvent:#doShowHelp: for:self withArguments:(Array with:aHelpText).
+        ].
+    ].
+
     ^true
+
+    "Modified: / 20.6.1998 / 16:47:37 / cg"
 !
 
 updateInfoLabel
@@ -1423,5 +1457,5 @@
 !ToolApplicationModel class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/ToolApplicationModel.st,v 1.60 1998-06-20 12:51:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/ToolApplicationModel.st,v 1.61 1998-06-20 14:48:01 cg Exp $'
 ! !