Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / Tk::Widget.3
CommitLineData
86530b38
AT
1.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "WIDGET 1"
132.TH WIDGET 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation"
133.SH "NAME"
134Tk::Widget \- Base class of all widgets
135.SH "SYNOPSIS"
136.IX Header "SYNOPSIS"
137.Vb 4
138\& package Tk::Whatever;
139\& require Tk::Widget;
140\& @ISA = qw(Tk::Widget);
141\& Construct Tk::Widget 'Whatever';
142.Ve
143.PP
144.Vb 1
145\& sub Tk_cmd { \e&Tk::whatever }
146.Ve
147.PP
148\&\ \fI$widget\fR\->\fImethod\fR(?\fIarg, arg, ...\fR?)
149.SH "DESCRIPTION"
150.IX Header "DESCRIPTION"
151The \fBTk::Widget\fR is an abstract base class for all Tk widgets.
152.PP
153Generic methods available to all widgets include the methods based on core
154\&\f(CW\*(C`winfo\*(C'\fR mechanism and are used to retrieve information about windows managed by
155Tk. They can take any of a number of different forms, depending on the \fImethod\fR.
156The legal forms are:
157.IP "\fI$widget\fR\->\fBappname\fR?(\fInewName\fR)?" 4
158.IX Item "$widget->appname?(newName)?"
159If \fInewName\fR isn't specified, this method returns the name
160of the application (the name that may be used in \fBsend\fR
161commands to communicate with the application).
162If \fInewName\fR is specified, then the name of the application
163is changed to \fInewName\fR.
164If the given name is already in use, then a suffix of the form
165``\fB #2\fR'' or ``\fB #3\fR'' is appended in order to make the name unique.
166The method's result is the name actually chosen.
167\&\fInewName\fR should not start with a capital letter.
168This will interfere with option processing, since names starting with
169capitals are assumed to be classes; as a result, Tk may not
170be able to find some options for the application.
171If sends have been disabled by deleting the \fBsend\fR command,
172this command will reenable them and recreate the \fBsend\fR
173command.
174.IP "\fI$widget\fR\->\fBatom\fR(\fIname\fR)" 4
175.IX Item "$widget->atom(name)"
176Returns a decimal string giving the integer identifier for the
177atom whose name is \fIname\fR. If no atom exists with the name
178\&\fIname\fR then a new one is created.
179.IP "\fI$widget\fR\->\fBatomname\fR(\fIid\fR)" 4
180.IX Item "$widget->atomname(id)"
181Returns the textual name for the atom whose integer identifier is
182\&\fIid\fR.
183This command is the inverse of the \fI$widget\fR\->\fBatom\fR command.
184It generates an error if no such atom exists.
185.IP "\fI$widget\fR\->\fBbell\fR" 4
186.IX Item "$widget->bell"
187This command rings the bell on the display for \fI$widget\fR and
188returns an empty string.
189The command uses the current bell-related settings for the display, which
190may be modified with programs such as \fBxset\fR.
191.Sp
192This command also resets the screen saver for the screen. Some
193screen savers will ignore this, but others will reset so that the
194screen becomes visible again.
195.IP "\fI$widget\fR\->\fBBusy\fR?(?\-recurse => 1?\fI\-option =\fR value>?)?" 4
196.IX Item "$widget->Busy?(?-recurse => 1?-option = value>?)?"
197This method \fBconfigure\fRs a \fB\-cursor\fR option for \fI$widget\fR and
198(if \fB\-recurse =\fR 1> is specified) all its descendants. The cursor to
199be set may be passed as \fB\-cursor\fR\ = \fIcursor\fR> or defaults to 'watch'.
200Additional \fBconfigure\fR options are applied to \fI$widget\fR only.
201It also adds a special tag \fB'Busy'\fR to the \fBbindtags\fR of the widgets so
202configured so that \fBKeyPress\fR, \fBKeyRelease\fR, \fBButtonPress\fR and
203\&\fBButtonRelease\fR events are ignored (with press events generating a call to
204\&\fBbell\fR). It then acquires a local \fBgrab\fR for \fI$widget\fR.
205The state of the widgets and the grab is restored by a call to
206\&\fI$widget\fR\->\fBUnbusy\fR.
207.IP "\fI$widget\fR\->\fBcells\fR" 4
208.IX Item "$widget->cells"
209Returns a decimal string giving the number of cells in the
210color map for \fI$widget\fR.
211.IP "\fI$widget\fR\->\fBchildren\fR" 4
212.IX Item "$widget->children"
213\&\fI$widget\-\fR>\fBchildren\fR
214Returns a list containing all the children
215of \f(CW$widget\fR. The list is in stacking order, with the lowest
216window first. Top-level windows are returned as children
217of their logical parents.
218.IP "\fI$widget\fR\->\fBclass\fR" 4
219.IX Item "$widget->class"
220Returns the class name for \fI$widget\fR.
221.IP "\fI$widget\fR\->\fBcolormapfull\fR" 4
222.IX Item "$widget->colormapfull"
223Returns 1 if the colormap for \fI$widget\fR is known to be full, 0
224otherwise. The colormap for a window is ``known'' to be full if the last
225attempt to allocate a new color on that window failed and this
226application hasn't freed any colors in the colormap since the
227failed allocation.
228.IP "\fI$widget\fR\->\fBcontaining\fR(\fIrootX,rootY\fR)" 4
229.IX Item "$widget->containing(rootX,rootY)"
230Returns the window containing the point given
231by \fIrootX\fR and \fIrootY\fR.
232\&\fIRootX\fR and \fIrootY\fR are specified in screen units (i.e.
233any form acceptable to \fBTk_GetPixels\fR) in the coordinate
234system of the root window (if a virtual-root window manager is in
235use then the coordinate system of the virtual root window is used).
236If no window in this application contains the point then an empty
237string is returned.
238In selecting the containing window, children are given higher priority
239than parents and among siblings the highest one in the stacking order is
240chosen.
241.IP "\fI$widget\fR\->\fBdepth\fR" 4
242.IX Item "$widget->depth"
243Returns a decimal string giving the depth of \fI$widget\fR (number
244of bits per pixel).
245.IP "\fI$widget\fR\->\fBdestroy\fR" 4
246.IX Item "$widget->destroy"
247This command deletes the window related to
248\&\fI$widget\fR, plus all its descendants.
249If all the \fBMainWindows\fR are deleted then the entire application
250will be destroyed.
251.Sp
252The perl object \fI$widget\fR continues to exist while references
253to it still exist, e.g. until variable goes out of scope.
254However any attempt to use Tk methods on the object will fail.
255\&\fBExists\fR(\fI$widget\fR) will return false on such objects.
256.Sp
257Note however that while a window exists for \fI$widget\fR the
258perl object is maintained (due to \*(L"references\*(R" in perl/Tk internals)
259even though original variables may have gone out of scope.
260(Normally this is intuitive.)
261.IP "\fBExists\fR(\fI$widget\fR)" 4
262.IX Item "Exists($widget)"
263Returns 1 if there exists a window for \fI$widget\fR, 0 if no such
264window exists.
265.IP "\fI$widget\fR\->\fBfont\fR(\fIoption\fR?, \fIarg, arg, ...\fR?)" 4
266.IX Item "$widget->font(option?, arg, arg, ...?)"
267Create and inspect fonts. See Tk::Font for further details.
268.IP "\fI$widget\fR\->\fBfpixels\fR(\fInumber\fR)" 4
269.IX Item "$widget->fpixels(number)"
270Returns a floating-point value giving the number of pixels
271in \fI$widget\fR corresponding to the distance given by \fInumber\fR.
272\&\fINumber\fR may be specified in any of the forms acceptable
273to \fBTk_GetScreenMM\fR, such as ``2.0c'' or ``1i''.
274The return value may be fractional; for an integer value, use
275\&\fI$widget\fR\->\fBpixels\fR.
276.IP "\fI$widget\fR\->\fBGetimage\fR(\fIname\fR)" 4
277.IX Item "$widget->Getimage(name)"
278Given \fIname\fR, look for an image file with that base name and return
279a Tk::Image. File extensions are tried in this order: \fIxpm\fR,
280\&\fIgif\fR, \fIppm\fR, \fIxbm\fR until a valid iamge is found. If no image is
281found, try a builtin image with that name.
282.IP "\fI$widget\fR\->\fBgeometry\fR" 4
283.IX Item "$widget->geometry"
284Returns the geometry for \fI$widget\fR, in the form
285\&\fIwidth\fR\fBx\fR\fIheight\fR\fB+\fR\fIx\fR\fB+\fR\fIy\fR. All dimensions are
286in pixels.
287.IP "\fI$widget\fR\->\fBheight\fR" 4
288.IX Item "$widget->height"
289Returns a decimal string giving \fI$widget\fR's height in pixels.
290When a window is first created its height will be 1 pixel; the
291height will eventually be changed by a geometry manager to fulfill
292the window's needs.
293If you need the true height immediately after creating a widget,
294invoke \fBupdate\fR to force the geometry manager to arrange it,
295or use \fI$widget\fR\->\fBreqheight\fR to get the window's requested height
296instead of its actual height.
297.IP "\fI$widget\fR\->\fBid\fR" 4
298.IX Item "$widget->id"
299Returns a hexadecimal string giving a low-level platform-specific
300identifier for \f(CW$widget\fR. On Unix platforms, this is the X
301window identifier. Under Windows, this is the Windows
302\&\s-1HWND\s0. On the Macintosh the value has no meaning outside Tk.
303.IP "\fI$widget\fR\->\fBidletasks\fR" 4
304.IX Item "$widget->idletasks"
305One of two methods which are used to bring the application ``up to date''
306by entering the event loop repeated until all pending events
307(including idle callbacks) have been processed.
308.Sp
309If the \fBidletasks\fR method is specified, then no new events or errors
310are processed; only idle callbacks are invoked. This causes operations
311that are normally deferred, such as display updates and window layout
312calculations, to be performed immediately.
313.Sp
314The \fBidletasks\fR command is useful in scripts where changes have been
315made to the application's state and you want those changes to appear
316on the display immediately, rather than waiting for the script to
317complete. Most display updates are performed as idle callbacks, so
318\&\fBidletasks\fR will cause them to run. However, there are some kinds of
319updates that only happen in response to events, such as those
320triggered by window size changes; these updates will not occur in
321\&\fBidletasks\fR.
322.IP "\fI$widget\fR\->\fBinterps\fR" 4
323.IX Item "$widget->interps"
324Returns a list whose members are the names of all Tcl interpreters
325(e.g. all Tk-based applications) currently registered for
326a particular display.
327The return value refers
328to the display of \fI$widget\fR.
329.IP "\fI$widget\fR\->\fBismapped\fR" 4
330.IX Item "$widget->ismapped"
331Returns \fB1\fR if \fI$widget\fR is currently mapped, \fB0\fR otherwise.
332.IP "\fI$widget\-\fR>\fBlower\fR(?\fIbelowThis\fR?)" 4
333.IX Item "$widget->lower(?belowThis?)"
334If the \fIbelowThis\fR argument is omitted then the command lowers
335\&\f(CW$widget\fR so that it is below all of its siblings in the stacking
336order (it will be obscured by any siblings that overlap it and
337will not obscure any siblings).
338If \fIbelowThis\fR is specified then it must be the path name of
339a window that is either a sibling of \f(CW$widget\fR or the descendant
340of a sibling of \f(CW$widget\fR.
341In this case the \fBlower\fR command will insert
342\&\f(CW$widget\fR into the stacking order just below \fIbelowThis\fR
343(or the ancestor of \fIbelowThis\fR that is a sibling of \f(CW$widget\fR);
344this could end up either raising or lowering \f(CW$widget\fR.
345.IP "\fI$widget\fR\->\fBMapWindow\fR" 4
346.IX Item "$widget->MapWindow"
347Cause \fI$widget\fR to be \*(L"mapped\*(R" i.e. made visible on the display.
348May confuse the geometry manager (pack, grid, place, ...)
349that thinks it is managing the widget.
350.IP "\fI$widget\fR\->\fBmanager\fR" 4
351.IX Item "$widget->manager"
352Returns the name of the geometry manager currently
353responsible for \fI$widget\fR, or an empty string if \fI$widget\fR
354isn't managed by any geometry manager.
355The name is usually the name of the method for the geometry
356manager, such as \fBpack\fR or \fBplace\fR.
357If the geometry manager is a widget, such as canvases or text, the
358name is the widget's class command, such as \fBcanvas\fR.
359.IP "\fI$widget\fR\->\fBname\fR" 4
360.IX Item "$widget->name"
361Returns \fI$widget\fR's name (i.e. its name within its parent, as opposed
362to its full path name).
363The command \fI$mainwin\fR\->\fBname\fR will return the name of the application.
364.IP "\fI$widget\fR\->\fBOnDestroy\fR(\fIcallback\fR);" 4
365.IX Item "$widget->OnDestroy(callback);"
366OnDestroy accepts a standard perl/Tk \fIcallback\fR.
367When the window associated with \fI$widget\fR is destroyed then
368the callback is invoked. Unlike \fI$widget\-\fR>bind('<Destroy>',...)
369the widgets methods are still available when \fIcallback\fR is executed,
370so (for example) a \fBText\fR widget can save its contents to a file.
371.Sp
372OnDestroy was required for new \fBafter\fR mechanism.
373.IP "\fI$widget\fR\->\fBparent\fR" 4
374.IX Item "$widget->parent"
375Returns \fI$widget\fR's parent, or an empty string
376if \fI$widget\fR is the main window of the application.
377.IP "\fI$widget\fR\->\fBPathName\fR" 4
378.IX Item "$widget->PathName"
379Returns the tk path name of \fI$widget\fR. (This is an import from the
380C interface.)
381.IP "\fI$widget\fR\->\fBpathname\fR(\fIid\fR)" 4
382.IX Item "$widget->pathname(id)"
383Returns an object whose X identifier is \fIid\fR.
384The identifier is looked up on the display of \fI$widget\fR.
385\&\fIId\fR must be a decimal, hexadecimal, or octal integer and must
386correspond to a window in the invoking application, or an error
387occurs which can be trapped with \f(CW\*(C`eval { }\*(C'\fR or \f(CW\*(C`Tk::catch { }\*(C'\fR.
388If the window belongs to the application, but is not an object
389(for example wrapper windows, HList header, etc.) then \f(CW\*(C`undef\*(C'\fR
390is returned.
391.IP "\fI$widget\fR\->\fBpixels\fR(\fInumber\fR)" 4
392.IX Item "$widget->pixels(number)"
393Returns the number of pixels in \fI$widget\fR corresponding
394to the distance given by \fInumber\fR.
395\&\fINumber\fR may be specified in any of the forms acceptable
396to \fBTk_GetPixels\fR, such as ``2.0c'' or ``1i''.
397The result is rounded to the nearest integer value; for a
398fractional result, use \fI$widget\fR\->\fBfpixels\fR.
399.IP "\fI$widget\fR\->\fBpointerx\fR" 4
400.IX Item "$widget->pointerx"
401If the mouse pointer is on the same screen as \fI$widget\fR, returns the
402pointer's x coordinate, measured in pixels in the screen's root window.
403If a virtual root window is in use on the screen, the position is
404measured in the virtual root.
405If the mouse pointer isn't on the same screen as \fI$widget\fR then
406\&\-1 is returned.
407.IP "\fI$widget\fR\->\fBpointerxy\fR" 4
408.IX Item "$widget->pointerxy"
409If the mouse pointer is on the same screen as \fI$widget\fR, returns a list
410with two elements, which are the pointer's x and y coordinates measured
411in pixels in the screen's root window.
412If a virtual root window is in use on the screen, the position
413is computed in the virtual root.
414If the mouse pointer isn't on the same screen as \fI$widget\fR then
415both of the returned coordinates are \-1.
416.IP "\fI$widget\fR\->\fBpointery\fR" 4
417.IX Item "$widget->pointery"
418If the mouse pointer is on the same screen as \fI$widget\fR, returns the
419pointer's y coordinate, measured in pixels in the screen's root window.
420If a virtual root window is in use on the screen, the position
421is computed in the virtual root.
422If the mouse pointer isn't on the same screen as \fI$widget\fR then
423\&\-1 is returned.
424.IP "\fI$widget\fR\->\fBraise\fR(?\fIaboveThis\fR?)" 4
425.IX Item "$widget->raise(?aboveThis?)"
426If the \fIaboveThis\fR argument is omitted then the command raises
427\&\f(CW$widget\fR so that it is above all of its siblings in the stacking
428order (it will not be obscured by any siblings and will obscure
429any siblings that overlap it).
430If \fIaboveThis\fR is specified then it must be the path name of
431a window that is either a sibling of \f(CW$widget\fR or the descendant
432of a sibling of \f(CW$widget\fR.
433In this case the \fBraise\fR command will insert
434\&\f(CW$widget\fR into the stacking order just above \fIaboveThis\fR
435(or the ancestor of \fIaboveThis\fR that is a sibling of \f(CW$widget\fR);
436this could end up either raising or lowering \f(CW$widget\fR.
437.IP "\fI$widget\fR\->\fBreqheight\fR" 4
438.IX Item "$widget->reqheight"
439Returns a decimal string giving \fI$widget\fR's requested height,
440in pixels. This is the value used by \fI$widget\fR's geometry
441manager to compute its geometry.
442.IP "\fI$widget\fR\->\fBreqwidth\fR" 4
443.IX Item "$widget->reqwidth"
444Returns a decimal string giving \fI$widget\fR's requested width,
445in pixels. This is the value used by \fI$widget\fR's geometry
446manager to compute its geometry.
447.IP "\fI$widget\fR\->\fBrgb\fR(\fIcolor\fR)" 4
448.IX Item "$widget->rgb(color)"
449Returns a list containing three decimal values, which are the
450red, green, and blue intensities that correspond to \fIcolor\fR in
451the window given by \fI$widget\fR. \fIColor\fR
452may be specified in any of the forms acceptable for a color
453option.
454.IP "\fI$widget\fR\->\fBrootx\fR" 4
455.IX Item "$widget->rootx"
456Returns a decimal string giving the x\-coordinate, in the root
457window of the screen, of the
458upper-left corner of \fI$widget\fR's border (or \fI$widget\fR if it
459has no border).
460.IP "\fI$widget\fR\->\fBrooty\fR" 4
461.IX Item "$widget->rooty"
462Returns a decimal string giving the y\-coordinate, in the root
463window of the screen, of the
464upper-left corner of \fI$widget\fR's border (or \fI$widget\fR if it
465has no border).
466.IP "\fBscaling\fR" 4
467.IX Item "scaling"
468.PD 0
469.IP "\fI$widget\fR\->\fBscaling\fR?(\fInumber\fR)?" 4
470.IX Item "$widget->scaling?(number)?"
471.PD
472Sets and queries the current scaling factor used by Tk to convert between
473physical units (for example, points, inches, or millimeters) and pixels. The
474\&\fInumber\fR argument is a floating point number that specifies the number of
475pixels per point on \f(CW$widget\fR's display. If the \fInumber\fR argument is
476omitted, the current value of the scaling factor is returned.
477.Sp
478A ``point'' is a unit of measurement equal to 1/72 inch. A scaling factor
479of 1.0 corresponds to 1 pixel per point, which is equivalent to a standard
48072 dpi monitor. A scaling factor of 1.25 would mean 1.25 pixels per point,
481which is the setting for a 90 dpi monitor; setting the scaling factor to
4821.25 on a 72 dpi monitor would cause everything in the application to be
483displayed 1.25 times as large as normal. The initial value for the scaling
484factor is set when the application starts, based on properties of the
485installed monitor (as reported via the window system),
486but it can be changed at any time. Measurements made
487after the scaling factor is changed will use the new scaling factor, but it
488is undefined whether existing widgets will resize themselves dynamically to
489accomodate the new scaling factor.
490.IP "\fI$widget\fR\->\fBscreen\fR" 4
491.IX Item "$widget->screen"
492Returns the name of the screen associated with \fI$widget\fR, in
493the form \fIdisplayName\fR.\fIscreenIndex\fR.
494.IP "\fI$widget\fR\->\fBscreencells\fR" 4
495.IX Item "$widget->screencells"
496Returns a decimal string giving the number of cells in the default
497color map for \fI$widget\fR's screen.
498.IP "\fI$widget\fR\->\fBscreendepth\fR" 4
499.IX Item "$widget->screendepth"
500Returns a decimal string giving the depth of the root window
501of \fI$widget\fR's screen (number of bits per pixel).
502.IP "\fI$widget\fR\->\fBscreenheight\fR" 4
503.IX Item "$widget->screenheight"
504Returns a decimal string giving the height of \fI$widget\fR's screen,
505in pixels.
506.IP "\fI$widget\fR\->\fBscreenmmheight\fR" 4
507.IX Item "$widget->screenmmheight"
508Returns a decimal string giving the height of \fI$widget\fR's screen,
509in millimeters.
510.IP "\fI$widget\fR\->\fBscreenmmwidth\fR" 4
511.IX Item "$widget->screenmmwidth"
512Returns a decimal string giving the width of \fI$widget\fR's screen,
513in millimeters.
514.IP "\fI$widget\fR\->\fBscreenvisual\fR" 4
515.IX Item "$widget->screenvisual"
516Returns one of the following strings to indicate the default visual
517class for \fI$widget\fR's screen: \fBdirectcolor\fR, \fBgrayscale\fR,
518\&\fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or
519\&\fBtruecolor\fR.
520.IP "\fI$widget\fR\->\fBscreenwidth\fR" 4
521.IX Item "$widget->screenwidth"
522Returns a decimal string giving the width of \fI$widget\fR's screen,
523in pixels.
524.IP "\fI$widget\fR\->\fBserver\fR" 4
525.IX Item "$widget->server"
526Returns a string containing information about the server for
527\&\fI$widget\fR's display. The exact format of this string may vary
528from platform to platform. For X servers the string
529has the form ``\fBX\fR\fImajor\fR\fBR\fR\fIminor vendor vendorVersion\fR''
530where \fImajor\fR and \fIminor\fR are the version and revision
531numbers provided by the server (e.g., \fBX11R5\fR), \fIvendor\fR
532is the name of the vendor for the server, and \fIvendorRelease\fR
533is an integer release number provided by the server.
534.IP "\fI$widget\fR\->\fBtoplevel\fR" 4
535.IX Item "$widget->toplevel"
536Returns the reference of the top-level window containing \fI$widget\fR.
537.IP "\fI$widget\fR\->\fBUnmapWindow\fR" 4
538.IX Item "$widget->UnmapWindow"
539Cause \fI$widget\fR to be \*(L"unmapped\*(R" i.e. removed from the display.
540This does for any widget what \fI$widget\fR\->withdraw does for
541toplevel widgets. May confuse the geometry manager (pack, grid, place, ...)
542that thinks it is managing the widget.
543.IP "\fI$widget\fR\->\fBupdate\fR" 4
544.IX Item "$widget->update"
545One of two methods which are used to bring the application ``up to date''
546by entering the event loop repeated until all pending events
547(including idle callbacks) have been processed.
548.Sp
549The \fBupdate\fR method is useful in scripts where you are performing a
550long-running computation but you still want the application to respond
551to events such as user interactions; if you occasionally call
552\&\fBupdate\fR then user input will be processed during the next call to
553\&\fBupdate\fR.
554.IP "\fI$widget\fR\->\fBUnbusy\fR" 4
555.IX Item "$widget->Unbusy"
556Restores widget state after a call to \fI$widget\fR\->\fBBusy\fR.
557.IP "\fI$widget\fR\->\fBviewable\fR" 4
558.IX Item "$widget->viewable"
559Returns 1 if \fI$widget\fR and all of its ancestors up through the
560nearest toplevel window are mapped. Returns 0 if any of these
561windows are not mapped.
562.IP "\fI$widget\fR\->\fBvisual\fR" 4
563.IX Item "$widget->visual"
564Returns one of the following strings to indicate the visual
565class for \fI$widget\fR: \fBdirectcolor\fR, \fBgrayscale\fR,
566\&\fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or
567\&\fBtruecolor\fR.
568.IP "\fI$widget\fR\->\fBvisualid\fR" 4
569.IX Item "$widget->visualid"
570Returns the X identifier for the visual for \f(CW$widget\fR.
571.IP "\fI$widget\fR\->\fBvisualsavailable\fR(?\fBincludeids\fR?)" 4
572.IX Item "$widget->visualsavailable(?includeids?)"
573Returns a list whose elements describe the visuals available for
574\&\fI$widget\fR's screen.
575Each element consists of a visual class followed by an integer depth.
576The class has the same form as returned by \fI$widget\fR\->\fBvisual\fR.
577The depth gives the number of bits per pixel in the visual.
578In addition, if the \fBincludeids\fR argument is provided, then the
579depth is followed by the X identifier for the visual.
580.IP "\fI$widget\fR\->\fBvrootheight\fR" 4
581.IX Item "$widget->vrootheight"
582Returns the height of the virtual root window associated with \fI$widget\fR
583if there is one; otherwise returns the height of \fI$widget\fR's screen.
584.IP "\fI$widget\fR\->\fBvrootwidth\fR" 4
585.IX Item "$widget->vrootwidth"
586Returns the width of the virtual root window associated with \fI$widget\fR
587if there is one; otherwise returns the width of \fI$widget\fR's screen.
588.IP "\fI$widget\fR\->\fBvrootx\fR" 4
589.IX Item "$widget->vrootx"
590Returns the x\-offset of the virtual root window associated with \fI$widget\fR,
591relative to the root window of its screen.
592This is normally either zero or negative.
593Returns 0 if there is no virtual root window for \fI$widget\fR.
594.IP "\fI$widget\fR\->\fBvrooty\fR" 4
595.IX Item "$widget->vrooty"
596Returns the y\-offset of the virtual root window associated with \fI$widget\fR,
597relative to the root window of its screen.
598This is normally either zero or negative.
599Returns 0 if there is no virtual root window for \fI$widget\fR.
600.IP "\fI$widget\-\fR>\fBwaitVariable\fR(\e$\fIname\fR)" 4
601.IX Item "$widget->waitVariable($name)"
602.PD 0
603.IP "\fI$widget\-\fR>\fBwaitVisibility\fR" 4
604.IX Item "$widget->waitVisibility"
605.IP "\fI$widget\-\fR>\fBwaitWindow\fR" 4
606.IX Item "$widget->waitWindow"
607.PD
608The \fBtk wait\fR methods wait for one of several things to happen,
609then it returns without taking any other actions.
610The return value is always an empty string.
611\&\fBwaitVariable\fR expects a reference to a perl
612variable and the command waits for that variable to be modified.
613This form is typically used to wait for a user to finish interacting
614with a dialog which sets the variable as part (possibly final)
615part of the interaction.
616\&\fBwaitVisibility\fR waits for a change in \fI$widget\fR's
617visibility state (as indicated by the arrival of a VisibilityNotify
618event). This form is typically used to wait for a newly-created
619window to appear on the screen before taking some action.
620\&\fBwaitWindow\fR waits for \fI$widget\fR to be destroyed.
621This form is typically used to wait for a user to finish interacting
622with a dialog box before using the result of that interaction.
623Note that creating and destroying the window each time a dialog is required
624makes code modular but imposes overhead which can be avoided by \fBwithdrawing\fR
625the window instead and using \fBwaitVisibility\fR.
626.Sp
627While the \fBtk wait\fR methods are waiting they processes events in
628the normal fashion, so the application will continue to respond
629to user interactions.
630If an event handler invokes \fBtkwait\fR again, the nested call
631to \fBtkwait\fR must complete before the outer call can complete.
632.IP "\fI$widget\fR\->\fBwidth\fR" 4
633.IX Item "$widget->width"
634Returns a decimal string giving \fI$widget\fR's width in pixels.
635When a window is first created its width will be 1 pixel; the
636width will eventually be changed by a geometry manager to fulfill
637the window's needs.
638If you need the true width immediately after creating a widget,
639invoke \fBupdate\fR to force the geometry manager to arrange it,
640or use \fI$widget\fR\->\fBreqwidth\fR to get the window's requested width
641instead of its actual width.
642.IP "\fI$widget\fR\->\fBx\fR" 4
643.IX Item "$widget->x"
644Returns a decimal string giving the x\-coordinate, in \fI$widget\fR's
645parent, of the upper-left corner of \fI$widget\fR's border (or \fI$widget\fR
646if it has no border).
647.IP "\fI$widget\fR\->\fBy\fR" 4
648.IX Item "$widget->y"
649Returns a decimal string giving the y\-coordinate, in \fI$widget\fR's
650parent, of the
651upper-left corner of \fI$widget\fR's border (or \fI$widget\fR if it
652has no border).
653.SH "CAVEATS"
654.IX Header "CAVEATS"
655The above documentaion on generic methods is incomplete.
656.SH "KEYWORDS"
657.IX Header "KEYWORDS"
658atom, children, class, geometry, height, identifier, information, interpreters,
659mapped, parent, path name, screen, virtual root, width, window