OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / SGI / util / SGI / man / mann / winop.n
1 '\"
2 '\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
3 '\"
4 '\" Permission to use, copy, modify, and distribute this software and its
5 '\" documentation for any purpose and without fee is hereby granted, provided
6 '\" that the above copyright notice appear in all copies and that both that the
7 '\" copyright notice and warranty disclaimer appear in supporting documentation,
8 '\" and that the names of Lucent Technologies any of their entities not be used
9 '\" in advertising or publicity pertaining to distribution of the software
10 '\" without specific, written prior permission.
11 '\"
12 '\" Lucent Technologies disclaims all warranties with regard to this software,
13 '\" including all implied warranties of merchantability and fitness.  In no event
14 '\" shall Lucent Technologies be liable for any special, indirect or
15 '\" consequential damages or any damages whatsoever resulting from loss of use,
16 '\" data or profits, whether in an action of contract, negligence or other
17 '\" tortuous action, arising out of or in connection with the use or performance
18 '\" of this software.  
19 '\"
20 '\" Window command created by George Howlett.
21 '\"
22 '\" The definitions below are for supplemental macros used in Tcl/Tk
23 '\" manual entries.
24 '\"
25 '\" .HS name section [date [version]]
26 '\"     Replacement for .TH in other man pages.  See below for valid
27 '\"     section names.
28 '\"
29 '\" .AP type name in/out [indent]
30 '\"     Start paragraph describing an argument to a library procedure.
31 '\"     type is type of argument (int, etc.), in/out is either "in", "out",
32 '\"     or "in/out" to describe whether procedure reads or modifies arg,
33 '\"     and indent is equivalent to second arg of .IP (shouldn't ever be
34 '\"     needed;  use .AS below instead)
35 '\"
36 '\" .AS [type [name]]
37 '\"     Give maximum sizes of arguments for setting tab stops.  Type and
38 '\"     name are examples of largest possible arguments that will be passed
39 '\"     to .AP later.  If args are omitted, default tab stops are used.
40 '\"
41 '\" .BS
42 '\"     Start box enclosure.  From here until next .BE, everything will be
43 '\"     enclosed in one large box.
44 '\"
45 '\" .BE
46 '\"     End of box enclosure.
47 '\"
48 '\" .VS
49 '\"     Begin vertical sidebar, for use in marking newly-changed parts
50 '\"     of man pages.
51 '\"
52 '\" .VE
53 '\"     End of vertical sidebar.
54 '\"
55 '\" .DS
56 '\"     Begin an indented unfilled display.
57 '\"
58 '\" .DE
59 '\"     End of indented unfilled display.
60 '\"
61 '\"     # Heading for Tcl/Tk man pages
62 .de HS
63 .if '\\$2'cmds'       .TH \\$1 1 \\$3 \\$4
64 .if '\\$2'lib'        .TH \\$1 3 \\$3 \\$4
65 .if '\\$2'tcl'        .TH \\$1 3 \\$3 \\$4
66 .if '\\$2'tk'         .TH \\$1 3 \\$3 \\$4
67 .if '\\$2'BLT'        .TH \\$1 "BLT 2.4" \\$3 \\$4
68 .if t .wh -1.3i ^B
69 .nr ^l \\n(.l
70 .ad b
71 ..
72 '\"     # Start an argument description
73 .de AP
74 .ie !"\\$4"" .TP \\$4
75 .el \{\
76 .   ie !"\\$2"" .TP \\n()Cu
77 .   el          .TP 15
78 .\}
79 .ie !"\\$3"" \{\
80 .ta \\n()Au \\n()Bu
81 \&\\$1  \\fI\\$2\\fP    (\\$3)
82 '\".b
83 .\}
84 .el \{\
85 .br
86 .ie !"\\$2"" \{\
87 \&\\$1  \\fI\\$2\\fP
88 .\}
89 .el \{\
90 \&\\fI\\$1\\fP
91 .\}
92 .\}
93 ..
94 '\"     # define tabbing values for .AP
95 .de AS
96 .nr )A 10n
97 .if !"\\$1"" .nr )A \\w'\\$1'u+3n
98 .nr )B \\n()Au+15n
99 '\"
100 .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
101 .nr )C \\n()Bu+\\w'(in/out)'u+2n
102 ..
103 '\"     # BS - start boxed text
104 '\"     # ^y = starting y location
105 '\"     # ^b = 1
106 .de BS
107 .br
108 .mk ^y
109 .nr ^b 1u
110 .if n .nf
111 .if n .ti 0
112 .if n \l'\\n(.lu\(ul'
113 .if n .fi
114 ..
115 '\"     # BE - end boxed text (draw box now)
116 .de BE
117 .nf
118 .ti 0
119 .mk ^t
120 .ie n \l'\\n(^lu\(ul'
121 .el \{\
122 '\"     Draw four-sided box normally, but don't draw top of
123 '\"     box if the box started on an earlier page.
124 .ie !\\n(^b-1 \{\
125 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
126 .\}
127 .el \}\
128 \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
129 .\}
130 .\}
131 .fi
132 .br
133 .nr ^b 0
134 ..
135 '\"     # VS - start vertical sidebar
136 '\"     # ^Y = starting y location
137 '\"     # ^v = 1 (for troff;  for nroff this doesn't matter)
138 .de VS
139 .mk ^Y
140 .ie n 'mc \s12\(br\s0
141 .el .nr ^v 1u
142 ..
143 '\"     # VE - end of vertical sidebar
144 .de VE
145 .ie n 'mc
146 .el \{\
147 .ev 2
148 .nf
149 .ti 0
150 .mk ^t
151 \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
152 .sp -1
153 .fi
154 .ev
155 .\}
156 .nr ^v 0
157 ..
158 '\"     # Special macro to handle page bottom:  finish off current
159 '\"     # box/sidebar if in box/sidebar mode, then invoked standard
160 '\"     # page bottom macro.
161 .de ^B
162 .ev 2
163 'ti 0
164 'nf
165 .mk ^t
166 .if \\n(^b \{\
167 '\"     Draw three-sided box if this is the box's first page,
168 '\"     draw two sides but no top otherwise.
169 .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
170 .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
171 .\}
172 .if \\n(^v \{\
173 .nr ^x \\n(^tu+1v-\\n(^Yu
174 \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
175 .\}
176 .bp
177 'fi
178 .ev
179 .if \\n(^b \{\
180 .mk ^y
181 .nr ^b 2
182 .\}
183 .if \\n(^v \{\
184 .mk ^Y
185 .\}
186 ..
187 '\"     # DS - begin display
188 .de DS
189 .RS
190 .ft CW
191 .nf
192 .sp
193 ..
194 '\"     # DE - end display
195 .de DE
196 .ft R
197 .fi
198 .sp
199 .RE
200 ..
201 .HS winop BLT
202 .BS
203 '\" Note:  do not modify the .SH NAME line immediately below!
204 .SH NAME
205 winop \- Perform assorted window operations
206 .SH SYNOPSIS
207 \fBwinop lower\fR ?\fIwindow\fR?...
208 .sp
209 \fBwinop map\fR ?\fIwindow\fR?...
210 .sp
211 \fBwinop move \fIwindow x y\fR
212 .sp
213 \fBwinop raise\fR ?\fIwindow\fR?...
214 .sp
215 \fBwinop snap \fIwindow photoName\fR
216 .sp
217 \fBwinop unmap\fR ?\fIwindow\fR?...
218 .sp
219 \fBwinop warpto\fR ?\fIwindow\fR?
220 .BE
221 .SH DESCRIPTION
222 The \fBwinop\fR command performs various window operations on Tk
223 windows using low-level Xlib function calls to work around window
224 manager pecularities.
225 .SH INTRODUCTION
226 Tk has several commands for manipulating its windows: \fBraise\fR,
227 \fBlower\fR, \fBwm\fR, etc.  These commands ask the window manager to
228 perform operations on Tk windows.  In some cases, a particular window
229 manager won't perform the operation as expected.
230 .PP
231 For example, if you positioned a toplevel window using \fBwm geometry\fR,
232 the window may not actually be at those particular coordinates.  The
233 position of the window may be offset by dimensions of the title bar added
234 by the window manager.  
235 .PP
236 In situations like these, the \fBwinop\fR command can be used to
237 workaround these difficulties.  Instead, it makes low-level Xlib
238 (such \fBXRaiseWindow\fR and \fBXMapWindow\fR) calls to perform these
239 operations.
240 .DS
241 toplevel .top
242 wm withdraw .top
243
244 # Set the geometry to make the window manager 
245 # place the window.
246 wm geometry .top +100+100
247
248 # Move the window to the desired location
249 # and "update" to force the window manager
250 # to recognize it.
251 winop move .top 100 100
252 update 
253
254 wm deiconify .top
255 winop move .top 100 100
256 .DE
257 .SH OPERATIONS
258 The following operations are available for the \fBwinop\fR command:
259 .TP
260 \fBwinop lower\fR ?\fIwindow\fR?...
261 Lowers \fIwindow\fR to the bottom of the X window stack.  \fIWindow\fR is
262 the path name of a Tk window.  
263 .TP
264 \fBwinop map\fR ?\fIwindow\fR?...
265 Maps \fIwindow\fR on the screen.  \fIWindow\fR
266 is the path name of a Tk window. If \fIwindow\fR is already mapped,
267 this command has no effect.  
268 .TP
269 \fBwinop move \fIwindow x y\fR
270 Move \fIwindow\fR to the screen location specified by \fIx\fR
271 and \fIy\fR. \fIWindow\fR is the path name of a Tk window, while
272 \fIx\fR and \fIy\fR are screen coordinates.  This command returns 
273 the empty string.
274 .TP
275 \fBwinop raise\fR ?\fIwindow\fR?...
276 Raises \fIwindow\fR to the top of the X window stack. \fIWindow\fR must be
277 a valid path name of a Tk window.  This command returns the empty string.
278 .TP
279 \fBwinop snap \fIwindow photoName\fR
280 Takes a snapshot of the \fIwindow\fR and stores the contents in the
281 photo image \fIphotoName\fR. \fIWindow\fR is the valid path name of a
282 Tk window which must be totally visible (unobscured).  \fIPhotoName\fR
283 is the name of a Tk photo image which must already exist.  This command
284 can fail if the window is obscured in any fashion, such as covered by 
285 another window or partially offscreen.  In that case, an error message
286 is returned.
287 .TP
288 \fBwinop unmap\fR ?\fIwindow\fR?...
289 Unmaps \fIwindow\fR from the screen. \fIWindow\fR is the path name of a Tk
290 window. 
291 .TP
292 \fBwinop warpto\fR ?\fIwindow\fR?
293 Warps the pointer to \fIwindow\fR. \fIWindow\fR is the path name of a Tk window
294 which must be mapped. If \fIwindow\fR is in the form \fI@x,y\fR, where
295 \fIx\fR and \fIy\fR are root screen coordinates, the pointer is warped to
296 that location on the screen.
297 .sp
298 [\fII've never heard a good case for warping the pointer in an
299 application.  It can be useful for testing, but in applications, it's
300 always a bad idea.  Simply stated, the user owns the pointer, not the
301 application.  If you have an application that needs it, I'd like to
302 hear about it.\fR]
303 .sp
304 If no \fIwindow\fR argument is present the current location of the
305 pointer is returned. The location is returned as a list in the form
306 "\fIx y\fR", where \fIx\fR and \fIy\fR are the current coordinates of
307 the pointer.
308 .SH KEYWORDS
309 window, map, raise, lower, pointer, warp