DisplayRootView.st
author claus
Fri, 16 Jul 1993 11:42:20 +0200
changeset 0 48194c26a46c
child 2 b35336ab0de3
permissions -rw-r--r--
Initial revision

"
 COPYRIGHT (c) 1988-93 by Claus Gittinger
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

PseudoView subclass:#DisplayRootView
       instanceVariableNames:'errorOccured'
       classVariableNames:''
       poolDictionaries:''
       category:'Views-Basic'
!

DisplayRootView comment:'
COPYRIGHT (c) 1988-93 by Claus Gittinger
              All Rights Reserved

this class describes Xs rootWindow (which is the background window and
must be used for drawing outside of Views i.e. for dragging between Views)

%W% %E%

written spring/summer 89 by claus
'!

Smalltalk at:#RootView put:nil!

!DisplayRootView class methodsFor:'initialization'!

initialize
    Display isNil ifTrue:[
        Workstation initialize
    ].
    super initialize
! !

!DisplayRootView class methodsFor:'instance creation'!

new
    "since there is only one RootView - catch new"
    RootView isNil ifTrue:[
        RootView := super new
    ].
    ^ RootView
! !

!DisplayRootView methodsFor:'initialization'!

initialize
    super initialize.
    width := device width.
    height := device height.
    realized := true.
    drawableId := device rootWindowFor:self
!

reinitialize
    "reinit after snapin"

    width := device width.
    height := device height.
    drawableId := device rootWindowFor:self
! !

!DisplayRootView methodsFor:'accessing'!

name
    ^ 'RootWindow'
!

controller
    ^ nil
! !

!DisplayRootView methodsFor:'queries'!

canDrop:anObjectOrCollection
    "return true, if anObjectOrCollection can be
     dropped in the receiver. This method should be
     redefined in views which can take objects"

    ^ false
! !

!DisplayRootView methodsFor:'window managing functions'!

errorInterrupt
    errorOccured := true
!

isWindowManagerRunning
    "answer true, if a window manager is currently running"

    |oldErrorHandler|

    oldErrorHandler := Smalltalk at:#ErrorInterruptHandler.
    Smalltalk at:#ErrorInterruptHandler put:self.
    errorOccured := false.
    self enableButtonEvents.
    device synchronizeOutput.
    Smalltalk at:#ErrorInterruptHandler put:oldErrorHandler.
    ^ errorOccured
! !