" Module : XW-DISPLAY-DEFS.ST Date : 5-Mar-1991 Version : 1.01-00 Modified: 04-Apr-1991 This module provides the display manager of the XWindow-Smalltalk interface. " " | Change log |============================================================================== | Author Date Change | | KAREN 11-Apr-1991 Added new instance variable activeController | | KAREN 04-Apr-1991 Added methods for XTranscript class | | KAREN 03-Apr-1991 Combined removeTextWindow and removeListBox | into removeWindow | KAREN 15-Mar-1991 Added methods for ListBox | " Object subclass: #XDisplay instanceVariableNames: 'windowDictionary activeController' classVariableNames: '' poolDictionaries: '' category: 'X-Windows'. ! ! XDisplay class methodsFor: 'creation'! new | newDisplay| newDisplay := super new. newDisplay initialize. ^newDisplay !! !XDisplay methodsFor: 'private'! initialize windowDictionary := Dictionary new. activeController := 0. ^self !! !XDisplay methodsFor: 'using'! addTranscript |newTranscript| newTranscript := XTranscript new. windowDictionary at:(newTranscript wId) put: newTranscript. ^newTranscript ! addTextWindow |newTextWindow| newTextWindow := XTextWindow new. windowDictionary at:(newTextWindow wId) put: newTextWindow. ^newTextWindow ! addListBox: aTitle with: someItems |newListBox| newListBox := XListBox new: aTitle with: someItems. windowDictionary at:(newListBox wId) put: newListBox. ^newListBox ! searchForActiveController |windowId window| (windowDictionary isEmpty) ifFalse: [ windowId := self findActiveWindow. window := windowDictionary at: windowId. self setActiveController: (window wController). self activateController. ] ifTrue: [ Smalltalk quitPrimitive. ]. ^self ! findActiveWindow ^self findActiveWindow ! activateController |quit| (activeController = 0) ifTrue: [ self searchForActiveController. ] ifFalse: [ activeController activate. quit := self checkQuit: activeController. (quit) ifTrue: [ self removeWindow: (activeController window). ]. self searchForActiveController. ]. ^self ! setActiveController: aController activeController := aController. ^self ! activeController ^activeController ! checkQuit: aController ^ aController isQuit ! removeWindow: aWindow windowDictionary removeKey: (aWindow wId). ^self !! |dynfun| dynfun := VmsDynamicFunction new. dynfun addLibrary: 'XWST_SHR'. dynfun defineExternFunc: 'find_active_window' withSelectorArgs:'findActiveWindow' forClass: XDisplay returning: #int args: #(). !