DisplayRootView.st
author claus
Thu, 02 Jun 1994 23:21:42 +0200
changeset 45 d2d5bc481ebb
parent 23 4a7e02de7b72
child 54 29a6b2f8e042
permissions -rw-r--r--
*** empty log message ***

"
 COPYRIGHT (c) 1988 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:''
       classVariableNames:''
       poolDictionaries:''
       category:'Views-Basic'
!

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

Smalltalk at:#RootView put:nil!

!DisplayRootView class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1988 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.
"
!

version
"
$Header: /cvs/stx/stx/libview/DisplayRootView.st,v 1.6 1994-06-02 21:21:42 claus Exp $
"
!

documentation
"
    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)
"
! !

!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.
    gcId := nil.
! !

!DisplayRootView methodsFor:'accessing'!

name
    ^ 'RootWindow'
!

controller
    ^ nil
!

sensor
    ^ 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
! 

isWindowManagerRunning
    "answer true, if a window manager is currently running.
     This is done by performing an action (enabling button events of
     root window), which will fail if a window manager is running."

    |errorOccured|

    errorOccured := false.
    device class deviceErrorSignal handle:[:ex |
        errorOccured := true.
        ex return
    ] do:[
        self enableButtonEvents.
        device synchronizeOutput.
    ].
    ^ errorOccured

    "RootView isWindowManagerRunning"
! !