diff -r 56f63eb42a34 -r 646d24a7ad36 UIPainter.st --- a/UIPainter.st Thu Jul 03 06:30:55 1997 +0200 +++ b/UIPainter.st Thu Jul 03 06:31:25 1997 +0200 @@ -808,31 +808,12 @@ !UIPainter methodsFor:'active help'! -activeHelpApplicationClass - "gets application class keeping the associated help component +activeHelpTool + "setup help tool " - |cls| - - specClass notNil ifTrue:[ - specClass isBehavior ifFalse:[cls := Smalltalk at:specClass asSymbol] - ifTrue:[cls := specClass]. - - (cls includesBehavior:UISpecification) ifTrue:[ - cls := UISpecificationTool - ] - ]. - ^ cls -! - -activeHelpTool - |cls| - activeHelpTool isNil ifTrue:[ activeHelpTool := UIHelpTool new. - - (cls := self activeHelpApplicationClass) notNil ifTrue:[ - activeHelpTool dictionary:(cls helpSpec). - ] + activeHelpTool helpSpecFrom:specClass. ]. ^ activeHelpTool ! @@ -1546,43 +1527,13 @@ ! doInstallHelp - |dict cls src| - - cls := self activeHelpApplicationClass. - - cls isNil ifTrue:[ - ^ self information:'no application class defined' - ]. - - activeHelpTool isNil ifTrue:[ - ^ self information:'no help text defined' - ]. - dict := activeHelpTool dictionary. - src := '' writeStream. - - src nextPutAll: - -'helpSpec - "return a dictionary filled with helpKey -> helptext associations. - These are used by the activeHelp tool. + "install help text " - ^ super helpSpec addPairsFrom:#( - -'. - - dict keysAndValuesDo:[:key :txt| - |t| - src nextPutLine:key storeString. - - t := txt asString. - (t endsWith:Character cr) ifTrue:[ - t := t copyWithoutLast:1 - ]. - src nextPutLine:t storeString; cr. - ]. - src nextPutLine:')'. - src := src contents. - Compiler compile:src forClass:cls class inCategory:'help specs' + activeHelpTool notNil ifTrue:[ + activeHelpTool installHelpSpecInto:specClass + ] ifFalse:[ + self information:'no help text defined' + ] ! doInstallSpec