" Module: XW-TRANS-CTRL-DEFS.ST Date: 4-Apr-1991 Version: 1.00-00 Modified: This module provides a controller for the transcript window of the X-Window interface. " " | Change Log | ============================================================================ | Author Date Change | ALISTAIR 13 Jul 91 Added doSelection and showSelection to pop up menu | | ALISTAIR 8 Apr 91 Fixed method compilation | " XWindowController subclass: #XTranscriptController instanceVariableNames: '' classVariableNames:'' poolDictionaries:'' category: 'X-Windows'. ! !XTranscriptController methodsFor: 'using'! controlActivity |action string key method count| ((action := window getCommand) ~= 0) ifTrue: [ (action = 2) ifTrue: [ string := window getText. Object class compileString: ('doIt ', string). Object doIt ]. (action = 3) ifTrue: [ string := window getPopupSelection. self perform: (string asSymbol) ]. (action = 4) ifTrue: [ Smalltalk quitPrimitive. ]. (action = 5) ifTrue: [ key := window getKeypress: 2. method := ('key', (key storeString)) asSymbol. (window respondsTo: method) ifTrue: [ window perform: method ] ifFalse: [ (key = 37) ifTrue: "% key" [ count := window getNumberOfLines. ('total ', (count printString)) printNl. count := window getLineNumber. ('line ', (count printString)) printNl. string := window getLine: count. string printNl. ] ifFalse: [ window insertChar: key ] ]. ]. (action = 6) ifTrue: [ self setActive: false. ]. ]. ! doSelection | string | string := window getText. Object class compileString: ('doIt ', string). Object doIt ! showSelection | string | string := window getText. Object class compileString: ('doIt (', string, ') printNl'). Object doIt !!