I received a question from a customer today - he wanted to use the features of the VW transcript in ObjectStudio 8. The ObjectStudio transcript is a read-only thing, and he wanted something more engaging. Rather than try to build up the OST tool, I figured "why not use the VW tool?"
So I asked a few questions, did some debugging, and came up with a handful of overrides that accomplished my goal. The first one: have a VW transcript open detached when you ask for a transcript from the launcher menu. To do that, I made these two changes in class GlobalDictionary:
activateProgramWindow
"if we use the VW Transcript, no need for this"
"<osprim: MAIN ActivateProgramWindowSystem>"
openProgramWindow
" Can't actually open program window, but the following is equivalent"
"use the VW Transcript instead"
Core.TextCollectorView open: Core.Transcript label: (#systemTranscript > 'System Transcript').
I commented out the rest of the code in that latter method. Then I needed to track down the implementations of #out - it turns out that all ObjectStudio objects use #out to dump themselves to the OST Transcript. So I overrode these three messages - first, in Object:
out
"Use VW Transcript instead"
Core.Transcript show: self print; cr
"<osprim: MAIN OutString>"
Then in Symbol:
out
"Use VW Transcript instead"
Core.Transcript show: self; cr.
"<osprim: MAIN OutString>"
And finally, in CharacterArray:
out
"Use VW Transcript instead"
Core.Transcript show: self; cr.
"<osprim: MAIN OutString>"
And that's it. Engineering tells me that there are some primitive uses of Transcript that this misses, but it covers nearly all cases - and it gives you a Transcript with some more functionality. To print to it yourself, just use standard ObjectStudio protocol (i.e., #out) - or look at class TextCollector for the VW level API to the object. Enjoy!
Technorati Tags:
objectstudio