" Module: XW-TEXT-CTRL-DEFS.ST Date: 5-Mar-1991 Version: 1.00-00 Modified: 03-Apr-1991 This module provides a controller for the text window of the X-Window interface. " " | Change Log |============================================================================== | Author Date Change | | KAREN 03-Apr-1991 Changed class definition to inherit from | general class XWindowController | " XWindowController subclass: #XTextWindowController instanceVariableNames: '' classVariableNames:'' poolDictionaries:'' category: 'X-Windows'. ! !XTextWindowController 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. ('Selected', string) printNl. ]. (action = 4) ifTrue: [ self setActive: false. self setQuit: true. ]. (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. ]. ]. !!