DisplayRootView.st
author Stefan Vogel <sv@exept.de>
Wed, 19 Mar 2014 11:05:13 +0100
changeset 6342 d2a4135ecf36
parent 6282 011a885412eb
child 6349 61ffd119fe62
permissions -rw-r--r--
Access graphicsDevice via method send instead of instVar access
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
48194c26a46c Initial revision
claus
parents:
diff changeset
     1
"
6
7ee0cfde237d *** empty log message ***
claus
parents: 3
diff changeset
     2
 COPYRIGHT (c) 1988 by Claus Gittinger
71
6a42b2b115f8 *** empty log message ***
claus
parents: 54
diff changeset
     3
	      All Rights Reserved
0
48194c26a46c Initial revision
claus
parents:
diff changeset
     4
48194c26a46c Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
48194c26a46c Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
48194c26a46c Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
48194c26a46c Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
48194c26a46c Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
48194c26a46c Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
48194c26a46c Initial revision
claus
parents:
diff changeset
    11
"
3253
0dd15811ccc2 dummies added
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
    12
"{ Package: 'stx:libview' }"
0dd15811ccc2 dummies added
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
    13
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents: 626
diff changeset
    14
DisplaySurface subclass:#DisplayRootView
616
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    15
	instanceVariableNames:''
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    16
	classVariableNames:''
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    17
	poolDictionaries:''
626
9f4a3aa6f8e2 class category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
    18
	category:'Views-Special'
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    19
!
48194c26a46c Initial revision
claus
parents:
diff changeset
    20
1254
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    21
!DisplayRootView class methodsFor:'documentation'!
45
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    22
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    23
copyright
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    24
"
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    25
 COPYRIGHT (c) 1988 by Claus Gittinger
71
6a42b2b115f8 *** empty log message ***
claus
parents: 54
diff changeset
    26
	      All Rights Reserved
45
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    27
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    28
 This software is furnished under a license and may be used
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    29
 only in accordance with the terms of that license and with the
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    31
 be provided or otherwise made available to, or used by, any
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    32
 other person.  No title to or ownership of the software is
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    33
 hereby transferred.
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    34
"
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    35
!
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    36
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    37
documentation
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    38
"
2916
79eedd2e05ac checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
    39
    this class describes the rootWindow (which is the background window or
79eedd2e05ac checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
    40
    desktop and can be used for drawing outside of Views 
79eedd2e05ac checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
    41
    i.e. for dragging between Views).
89
ea2bf46eb669 *** empty log message ***
claus
parents: 71
diff changeset
    42
1254
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    43
    For historic and compatibility reasons, there is a global variable 
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    44
    called 'RootView', which is bound to the default displays ('Display')
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    45
    rootview. We recommend, not to access this variable, instead, get a
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    46
    displays rootView via the #rootView message (sent to the device).
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    47
    Otherwise, your application will not work in a multiScreen environment.
180
claus
parents: 134
diff changeset
    48
claus
parents: 134
diff changeset
    49
    Instances of myself (i.e. these rootViews) are light-weight views; 
claus
parents: 134
diff changeset
    50
    they do not support events, models etc.
claus
parents: 134
diff changeset
    51
    They are pure drawing canvases and should be only used for special
1254
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    52
    applications (i.e. dragging). 
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    53
    There may be display systems in which rootViews are not
180
claus
parents: 134
diff changeset
    54
    supported/allowed implemented. So be VERY careful when using them.
134
claus
parents: 109
diff changeset
    55
1254
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    56
    Be aware, that the rootView is not always visible - some
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    57
    windowManagers install another (pseudoRoot), into which icons and
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    58
    windowManager menus are drawn. If that is the case, your paining
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    59
    into the rootView may not be visible, unless you set the #noClipByChildren
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    60
    option (see below).
2916
79eedd2e05ac checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
    61
    Also, it is not guaranteed, that all devices support drawing in the
79eedd2e05ac checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
    62
    root window - especially if the device is a simulated one, such as
79eedd2e05ac checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
    63
    a remote webBrowser ...
1254
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    64
    In general, you should never use the rootView for normal applications.
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    65
134
claus
parents: 109
diff changeset
    66
    To draw in the (Displays) root window:
89
ea2bf46eb669 *** empty log message ***
claus
parents: 71
diff changeset
    67
1254
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    68
        |rootView|
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    69
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    70
        rootView := Screen current rootView.
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    71
        rootView paint:(Color red).
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    72
        rootView fillRectangleX:10 y:10 width:100 height:100.
89
ea2bf46eb669 *** empty log message ***
claus
parents: 71
diff changeset
    73
ea2bf46eb669 *** empty log message ***
claus
parents: 71
diff changeset
    74
    of course, all stuff from View and its superclasses can be used:
ea2bf46eb669 *** empty log message ***
claus
parents: 71
diff changeset
    75
1254
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    76
        |rootView|
89
ea2bf46eb669 *** empty log message ***
claus
parents: 71
diff changeset
    77
1254
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    78
        rootView := Screen current rootView.
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    79
        rootView paint:(Color red).
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    80
        rootView noClipByChildren.
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    81
        rootView fillRectangleX:10 y:10 width:100 height:100.
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    82
616
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    83
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    84
    [author:]
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    85
        Claus Gittinger
45
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    86
"
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    87
! !
d2d5bc481ebb *** empty log message ***
claus
parents: 23
diff changeset
    88
1254
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
    89
!DisplayRootView class methodsFor:'instance creation'!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    90
1256
4a633daff594 on: -> onDevice:
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
    91
onDevice:aDisplay
89
ea2bf46eb669 *** empty log message ***
claus
parents: 71
diff changeset
    92
    "since there is only one RootView - catch new and return
ea2bf46eb669 *** empty log message ***
claus
parents: 71
diff changeset
    93
     the one and only rootView."
ea2bf46eb669 *** empty log message ***
claus
parents: 71
diff changeset
    94
134
claus
parents: 109
diff changeset
    95
    aDisplay == Display ifTrue:[
3337
65bba570ff76 care for changed display (in cached RootView)
martin
parents: 3253
diff changeset
    96
        RootView notNil ifTrue:[
65bba570ff76 care for changed display (in cached RootView)
martin
parents: 3253
diff changeset
    97
            RootView device == aDisplay ifTrue:[
65bba570ff76 care for changed display (in cached RootView)
martin
parents: 3253
diff changeset
    98
                ^ RootView
65bba570ff76 care for changed display (in cached RootView)
martin
parents: 3253
diff changeset
    99
            ]
65bba570ff76 care for changed display (in cached RootView)
martin
parents: 3253
diff changeset
   100
        ].
1256
4a633daff594 on: -> onDevice:
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   101
        RootView := super onDevice:aDisplay.
4a633daff594 on: -> onDevice:
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   102
        ^ RootView
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   103
    ].
1256
4a633daff594 on: -> onDevice:
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   104
    ^ super onDevice:aDisplay
4a633daff594 on: -> onDevice:
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   105
3630
2b2f6649c014 Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 3337
diff changeset
   106
    "Created: 18.1.1997 / 18:23:22 / cg"
2b2f6649c014 Change Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 3337
diff changeset
   107
! !
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   108
48194c26a46c Initial revision
claus
parents:
diff changeset
   109
!DisplayRootView methodsFor:'accessing'!
48194c26a46c Initial revision
claus
parents:
diff changeset
   110
4213
38e47961a6cc *** empty log message ***
penk
parents: 4042
diff changeset
   111
application
38e47961a6cc *** empty log message ***
penk
parents: 4042
diff changeset
   112
    ^ nil
38e47961a6cc *** empty log message ***
penk
parents: 4042
diff changeset
   113
!
38e47961a6cc *** empty log message ***
penk
parents: 4042
diff changeset
   114
4214
4b2fa686d9a1 *** empty log message ***
penk
parents: 4213
diff changeset
   115
model
4b2fa686d9a1 *** empty log message ***
penk
parents: 4213
diff changeset
   116
    ^ nil
4b2fa686d9a1 *** empty log message ***
penk
parents: 4213
diff changeset
   117
!
4b2fa686d9a1 *** empty log message ***
penk
parents: 4213
diff changeset
   118
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   119
name
2916
79eedd2e05ac checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
   120
    "return my name - always 'RootWindow'"
79eedd2e05ac checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
   121
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   122
    ^ 'RootWindow'
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   123
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   124
3253
0dd15811ccc2 dummies added
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   125
subViews
0dd15811ccc2 dummies added
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   126
    "return the collection of subviews - none here"
0dd15811ccc2 dummies added
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   127
0dd15811ccc2 dummies added
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   128
    ^ #()
0dd15811ccc2 dummies added
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   129
0dd15811ccc2 dummies added
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   130
4981
780ccc05227b +view uuids
fm
parents: 4650
diff changeset
   131
!
780ccc05227b +view uuids
fm
parents: 4650
diff changeset
   132
780ccc05227b +view uuids
fm
parents: 4650
diff changeset
   133
uuid
4989
fm
parents: 4981
diff changeset
   134
    "return my uuid - always the same here.
fm
parents: 4981
diff changeset
   135
     TODO: think what happens with multiple screens..."
4981
780ccc05227b +view uuids
fm
parents: 4650
diff changeset
   136
780ccc05227b +view uuids
fm
parents: 4650
diff changeset
   137
    ^ UUID readFrom:'31be9300-41fc-11dd-b99f-001558137da0'  "/ do not change - ask cg if you dont know why
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   138
! !
48194c26a46c Initial revision
claus
parents:
diff changeset
   139
71
6a42b2b115f8 *** empty log message ***
claus
parents: 54
diff changeset
   140
!DisplayRootView methodsFor:'destroying'!
6a42b2b115f8 *** empty log message ***
claus
parents: 54
diff changeset
   141
6a42b2b115f8 *** empty log message ***
claus
parents: 54
diff changeset
   142
destroy
6a42b2b115f8 *** empty log message ***
claus
parents: 54
diff changeset
   143
    "catch destroy - some windowmanagers get confused if
6a42b2b115f8 *** empty log message ***
claus
parents: 54
diff changeset
   144
     we destroy the rootWindow if its a virtual root window"
6a42b2b115f8 *** empty log message ***
claus
parents: 54
diff changeset
   145
6a42b2b115f8 *** empty log message ***
claus
parents: 54
diff changeset
   146
    ^ self
6a42b2b115f8 *** empty log message ***
claus
parents: 54
diff changeset
   147
! !
6a42b2b115f8 *** empty log message ***
claus
parents: 54
diff changeset
   148
3253
0dd15811ccc2 dummies added
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   149
!DisplayRootView methodsFor:'dummy'!
0dd15811ccc2 dummies added
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   150
0dd15811ccc2 dummies added
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   151
redrawX:x y:y width:width height:height
0dd15811ccc2 dummies added
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   152
    "ignored"
0dd15811ccc2 dummies added
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   153
! !
0dd15811ccc2 dummies added
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   154
3883
4e01a59afccb method category rename
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
   155
!DisplayRootView methodsFor:'initialization & release'!
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   156
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   157
initialize
6233
b746fb9ba0e3 class: DisplayRootView
Stefan Vogel <sv@exept.de>
parents: 4989
diff changeset
   158
    |dev|
b746fb9ba0e3 class: DisplayRootView
Stefan Vogel <sv@exept.de>
parents: 4989
diff changeset
   159
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   160
    super initialize.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   161
6233
b746fb9ba0e3 class: DisplayRootView
Stefan Vogel <sv@exept.de>
parents: 4989
diff changeset
   162
    dev := self device.
b746fb9ba0e3 class: DisplayRootView
Stefan Vogel <sv@exept.de>
parents: 4989
diff changeset
   163
    width := dev width.
b746fb9ba0e3 class: DisplayRootView
Stefan Vogel <sv@exept.de>
parents: 4989
diff changeset
   164
    height := dev height.
6342
d2a4135ecf36 Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents: 6282
diff changeset
   165
    self createRootWindow.
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   166
    realized := true.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   167
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   168
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   169
reinitialize
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   170
    "reinit after snapin"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   171
6233
b746fb9ba0e3 class: DisplayRootView
Stefan Vogel <sv@exept.de>
parents: 4989
diff changeset
   172
    |dev|
b746fb9ba0e3 class: DisplayRootView
Stefan Vogel <sv@exept.de>
parents: 4989
diff changeset
   173
6342
d2a4135ecf36 Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents: 6282
diff changeset
   174
    dev := self graphicsDevice.
6233
b746fb9ba0e3 class: DisplayRootView
Stefan Vogel <sv@exept.de>
parents: 4989
diff changeset
   175
    width := dev width.
b746fb9ba0e3 class: DisplayRootView
Stefan Vogel <sv@exept.de>
parents: 4989
diff changeset
   176
    height := dev height.
6342
d2a4135ecf36 Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents: 6282
diff changeset
   177
    self createRootWindow.
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   178
    realized := true.
6342
d2a4135ecf36 Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents: 6282
diff changeset
   179
    self recreate.
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   180
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   181
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   182
!DisplayRootView methodsFor:'queries'!
48194c26a46c Initial revision
claus
parents:
diff changeset
   183
4650
fd25e32de1e3 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 4221
diff changeset
   184
canDropObjects:aCollectionOfDropObjects
1584
03d62f063935 drop argument is always a collection
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
   185
    "return true, if aCollectionOfDropObjects can be
2916
79eedd2e05ac checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
   186
     dropped in the receiver. 
79eedd2e05ac checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
   187
     False is returned here, since nothing can be dropped on the desktop.
79eedd2e05ac checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
   188
     (for now - actually some systems do allow dropping things on the desktop
79eedd2e05ac checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
   189
      and this query should be forwarded to my display device)"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   190
48194c26a46c Initial revision
claus
parents:
diff changeset
   191
    ^ false
1584
03d62f063935 drop argument is always a collection
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
   192
4650
fd25e32de1e3 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 4221
diff changeset
   193
    "Created: / 13-10-2006 / 15:55:54 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   194
!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   195
919
47b7aff0f1e4 added #isRootView & #shown queries
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   196
isRootView
2916
79eedd2e05ac checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
   197
    "return true, since yes, I am a rootview"
919
47b7aff0f1e4 added #isRootView & #shown queries
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   198
47b7aff0f1e4 added #isRootView & #shown queries
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   199
    ^ true
47b7aff0f1e4 added #isRootView & #shown queries
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   200
47b7aff0f1e4 added #isRootView & #shown queries
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   201
    "Created: 5.7.1996 / 13:48:24 / cg"
47b7aff0f1e4 added #isRootView & #shown queries
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   202
    "Modified: 5.7.1996 / 14:57:44 / cg"
47b7aff0f1e4 added #isRootView & #shown queries
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   203
!
47b7aff0f1e4 added #isRootView & #shown queries
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   204
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   205
isWindowManagerRunning
2
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
   206
    "answer true, if a window manager is currently running.
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
   207
     This is done by performing an action (enabling button events of
23
4a7e02de7b72 *** empty log message ***
claus
parents: 6
diff changeset
   208
     root window), which will fail if a window manager is running."
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   209
6267
5eb0ba53aa2a class: DisplayRootView
Stefan Vogel <sv@exept.de>
parents: 6233
diff changeset
   210
    self graphicsDevice platformName = 'WIN32' ifTrue:[^ true].
2916
79eedd2e05ac checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
   211
6267
5eb0ba53aa2a class: DisplayRootView
Stefan Vogel <sv@exept.de>
parents: 6233
diff changeset
   212
    self graphicsDevice class deviceErrorSignal handle:[:ex |
4221
666dea8f4aa7 Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents: 4214
diff changeset
   213
        ^ false.
2
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
   214
    ] do:[
2916
79eedd2e05ac checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
   215
        self enableButtonEvents.
6267
5eb0ba53aa2a class: DisplayRootView
Stefan Vogel <sv@exept.de>
parents: 6233
diff changeset
   216
        self flush.
2
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
   217
    ].
4221
666dea8f4aa7 Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents: 4214
diff changeset
   218
    ^ true
23
4a7e02de7b72 *** empty log message ***
claus
parents: 6
diff changeset
   219
134
claus
parents: 109
diff changeset
   220
    "
claus
parents: 109
diff changeset
   221
     DisplayRootView new
claus
parents: 109
diff changeset
   222
     RootView isWindowManagerRunning
claus
parents: 109
diff changeset
   223
    "
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   224
! !
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   225
1254
6bb4afe072f1 commentary
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
   226
!DisplayRootView class methodsFor:'documentation'!
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   227
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   228
version
6342
d2a4135ecf36 Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents: 6282
diff changeset
   229
    ^ '$Header: /cvs/stx/stx/libview/DisplayRootView.st,v 1.40 2014-03-19 10:05:13 stefan Exp $'
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   230
! !
6233
b746fb9ba0e3 class: DisplayRootView
Stefan Vogel <sv@exept.de>
parents: 4989
diff changeset
   231