equal
deleted
inserted
replaced
19 |
19 |
20 DisplayRootView comment:' |
20 DisplayRootView comment:' |
21 COPYRIGHT (c) 1988 by Claus Gittinger |
21 COPYRIGHT (c) 1988 by Claus Gittinger |
22 All Rights Reserved |
22 All Rights Reserved |
23 |
23 |
24 $Header: /cvs/stx/stx/libview/DisplayRootView.st,v 1.8 1994-10-10 02:29:37 claus Exp $ |
24 $Header: /cvs/stx/stx/libview/DisplayRootView.st,v 1.9 1995-02-06 00:35:46 claus Exp $ |
25 '! |
25 '! |
26 |
26 |
27 Smalltalk at:#RootView put:nil! |
27 Smalltalk at:#RootView put:nil! |
28 |
28 |
29 !DisplayRootView class methodsFor:'documentation'! |
29 !DisplayRootView class methodsFor:'documentation'! |
42 " |
42 " |
43 ! |
43 ! |
44 |
44 |
45 version |
45 version |
46 " |
46 " |
47 $Header: /cvs/stx/stx/libview/DisplayRootView.st,v 1.8 1994-10-10 02:29:37 claus Exp $ |
47 $Header: /cvs/stx/stx/libview/DisplayRootView.st,v 1.9 1995-02-06 00:35:46 claus Exp $ |
48 " |
48 " |
49 ! |
49 ! |
50 |
50 |
51 documentation |
51 documentation |
52 " |
52 " |
53 this class describes Xs rootWindow (which is the background window and |
53 this class describes Xs rootWindow (which is the background window and |
54 must be used for drawing outside of Views i.e. for dragging between Views) |
54 must be used for drawing outside of Views i.e. for dragging between Views). |
|
55 |
|
56 To draw in the root window: |
|
57 |
|
58 RootView paint:(Color red). |
|
59 RootView fillRectangleX:10 y:10 width:100 height:100. |
|
60 |
|
61 of course, all stuff from View and its superclasses can be used: |
|
62 |
|
63 RootView paint:(Color red). |
|
64 RootView noClipByChildren. |
|
65 RootView fillRectangleX:10 y:10 width:100 height:100. |
|
66 |
|
67 you have to be careful with some window managers, since what you |
|
68 see on the screen is not always really the root window. Some Desktops |
|
69 add their own view in between (although the Xworkstation class does |
|
70 care for this, it seems not to work correctly on all systems). |
|
71 In general, you should never use the RootView for normal applications. |
55 " |
72 " |
56 ! ! |
73 ! ! |
57 |
74 |
58 !DisplayRootView class methodsFor:'initialization'! |
75 !DisplayRootView class methodsFor:'initialization'! |
59 |
76 |
65 ! ! |
82 ! ! |
66 |
83 |
67 !DisplayRootView class methodsFor:'instance creation'! |
84 !DisplayRootView class methodsFor:'instance creation'! |
68 |
85 |
69 new |
86 new |
70 "since there is only one RootView - catch new" |
87 "since there is only one RootView - catch new and return |
|
88 the one and only rootView." |
|
89 |
71 RootView isNil ifTrue:[ |
90 RootView isNil ifTrue:[ |
72 RootView := super new |
91 RootView := super new |
73 ]. |
92 ]. |
74 ^ RootView |
93 ^ RootView |
75 ! ! |
94 ! ! |
76 |
95 |
77 !DisplayRootView methodsFor:'initialization'! |
96 !DisplayRootView methodsFor:'initialization'! |
78 |
97 |
79 initialize |
98 initialize |
80 super initialize. |
99 super initialize. |
|
100 |
81 width := device width. |
101 width := device width. |
82 height := device height. |
102 height := device height. |
|
103 drawableId := device rootWindowFor:self. |
83 realized := true. |
104 realized := true. |
84 drawableId := device rootWindowFor:self |
|
85 ! |
105 ! |
86 |
106 |
87 reinitialize |
107 reinitialize |
88 "reinit after snapin" |
108 "reinit after snapin" |
89 |
109 |
90 width := device width. |
110 width := device width. |
91 height := device height. |
111 height := device height. |
92 drawableId := device rootWindowFor:self. |
112 drawableId := device rootWindowFor:self. |
|
113 realized := true. |
93 gcId := nil. |
114 gcId := nil. |
94 ! ! |
115 ! ! |
95 |
116 |
96 !DisplayRootView methodsFor:'accessing'! |
117 !DisplayRootView methodsFor:'accessing'! |
97 |
118 |