DisplayRootView.st
changeset 1254 6bb4afe072f1
parent 919 47b7aff0f1e4
child 1256 4a633daff594
equal deleted inserted replaced
1253:04bd9de0cac4 1254:6bb4afe072f1
    15 	classVariableNames:''
    15 	classVariableNames:''
    16 	poolDictionaries:''
    16 	poolDictionaries:''
    17 	category:'Views-Special'
    17 	category:'Views-Special'
    18 !
    18 !
    19 
    19 
    20 !DisplayRootView  class methodsFor:'documentation'!
    20 !DisplayRootView class methodsFor:'documentation'!
    21 
    21 
    22 copyright
    22 copyright
    23 "
    23 "
    24  COPYRIGHT (c) 1988 by Claus Gittinger
    24  COPYRIGHT (c) 1988 by Claus Gittinger
    25 	      All Rights Reserved
    25 	      All Rights Reserved
    36 documentation
    36 documentation
    37 "
    37 "
    38     this class describes Xs rootWindow (which is the background window and
    38     this class describes Xs rootWindow (which is the background window and
    39     can be used for drawing outside of Views i.e. for dragging between Views).
    39     can be used for drawing outside of Views i.e. for dragging between Views).
    40 
    40 
    41     There is one global variable (RootView) which is the Displays rootview.
    41     For historic and compatibility reasons, there is a global variable 
    42     (this is the default displays rootView; to access other devices' rootView,
    42     called 'RootView', which is bound to the default displays ('Display')
    43      use someDisplay rootView),
    43     rootview. We recommend, not to access this variable, instead, get a
       
    44     displays rootView via the #rootView message (sent to the device).
       
    45     Otherwise, your application will not work in a multiScreen environment.
    44 
    46 
    45     Instances of myself (i.e. these rootViews) are light-weight views; 
    47     Instances of myself (i.e. these rootViews) are light-weight views; 
    46     they do not support events, models etc.
    48     they do not support events, models etc.
    47     They are pure drawing canvases and should be only used for special
    49     They are pure drawing canvases and should be only used for special
    48     applications. There may be display systems in which rootViews are not
    50     applications (i.e. dragging). 
       
    51     There may be display systems in which rootViews are not
    49     supported/allowed implemented. So be VERY careful when using them.
    52     supported/allowed implemented. So be VERY careful when using them.
    50 
    53 
       
    54     Be aware, that the rootView is not always visible - some
       
    55     windowManagers install another (pseudoRoot), into which icons and
       
    56     windowManager menus are drawn. If that is the case, your paining
       
    57     into the rootView may not be visible, unless you set the #noClipByChildren
       
    58     option (see below).
       
    59 
       
    60     In general, you should never use the rootView for normal applications.
       
    61 
    51     To draw in the (Displays) root window:
    62     To draw in the (Displays) root window:
    52 
    63 
    53         RootView paint:(Color red).
    64         |rootView|
    54         RootView fillRectangleX:10 y:10 width:100 height:100.
    65 
       
    66         rootView := Screen current rootView.
       
    67         rootView paint:(Color red).
       
    68         rootView fillRectangleX:10 y:10 width:100 height:100.
    55 
    69 
    56     of course, all stuff from View and its superclasses can be used:
    70     of course, all stuff from View and its superclasses can be used:
    57 
    71 
    58         RootView paint:(Color red).
    72         |rootView|
    59         RootView noClipByChildren.
    73 
    60         RootView fillRectangleX:10 y:10 width:100 height:100.
    74         rootView := Screen current rootView.
    61 
    75         rootView paint:(Color red).
    62     you have to be careful with some window managers, since what you
    76         rootView noClipByChildren.
    63     see on the screen is not always really the root window. Some Desktops
    77         rootView fillRectangleX:10 y:10 width:100 height:100.
    64     add their own view in between (although the Xworkstation class does
    78 
    65     care for this, it seems not to work correctly on all systems).
       
    66     In general, you should never use the RootView for normal applications.
       
    67 
    79 
    68     [author:]
    80     [author:]
    69         Claus Gittinger
    81         Claus Gittinger
    70 "
    82 "
    71 ! !
    83 ! !
    72 
    84 
    73 !DisplayRootView  class methodsFor:'initialization'!
    85 !DisplayRootView class methodsFor:'initialization'!
    74 
    86 
    75 initialize
    87 initialize
    76     Display isNil ifTrue:[
    88     Display isNil ifTrue:[
    77 	Workstation initialize
    89 	Workstation initialize
    78     ].
    90     ].
    79     super initialize
    91     super initialize
    80 ! !
    92 ! !
    81 
    93 
    82 !DisplayRootView  class methodsFor:'instance creation'!
    94 !DisplayRootView class methodsFor:'instance creation'!
    83 
    95 
    84 on:aDisplay
    96 on:aDisplay
    85     "since there is only one RootView - catch new and return
    97     "since there is only one RootView - catch new and return
    86      the one and only rootView."
    98      the one and only rootView."
    87 
    99 
   196 
   208 
   197     "Created: 5.7.1996 / 13:48:05 / cg"
   209     "Created: 5.7.1996 / 13:48:05 / cg"
   198     "Modified: 5.7.1996 / 14:57:34 / cg"
   210     "Modified: 5.7.1996 / 14:57:34 / cg"
   199 ! !
   211 ! !
   200 
   212 
   201 !DisplayRootView  class methodsFor:'documentation'!
   213 !DisplayRootView class methodsFor:'documentation'!
   202 
   214 
   203 version
   215 version
   204     ^ '$Header: /cvs/stx/stx/libview/DisplayRootView.st,v 1.18 1996-07-05 12:58:04 cg Exp $'
   216     ^ '$Header: /cvs/stx/stx/libview/DisplayRootView.st,v 1.19 1997-01-18 17:22:06 cg Exp $'
   205 ! !
   217 ! !
   206 DisplayRootView initialize!
   218 DisplayRootView initialize!