home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / perl / Widget.pod < prev    next >
Encoding:
Text File  |  2003-09-26  |  22.8 KB  |  633 lines

  1. #  Copyright (c) 1990-1994 The Regents of the University of California.
  2. #  Copyright (c) 1994-1997 Sun Microsystems, Inc.
  3. #  See the file "license.terms" for information on usage and redistribution
  4. #  of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  5. #
  6. #
  7.  
  8. =head1 NAME
  9.  
  10. Tk::Widget - Base class of all widgets
  11.  
  12. =for pm Tk/Widget.pm
  13.  
  14. =for category Tk Generic Methods
  15.  
  16. =head1 SYNOPSIS
  17.  
  18.    package Tk::Whatever;
  19.    require Tk::Widget;
  20.    @ISA = qw(Tk::Widget);
  21.    Construct Tk::Widget 'Whatever';
  22.  
  23.    sub Tk_cmd { \&Tk::whatever }
  24.  
  25. S<   >I<$widget>-E<gt>I<method>(?I<arg, arg, ...>?)
  26.  
  27. =head1 DESCRIPTION
  28.  
  29. The B<Tk::Widget> is an abstract base class for all Tk widgets.
  30.  
  31. Generic methods available to all widgets include the methods based on core
  32. C<winfo> mechanism and are used to retrieve information about windows managed by
  33. Tk. They can take any of a number of different forms, depending on the I<method>.
  34. The legal forms are:
  35.  
  36. =over 4
  37.  
  38. =item I<$widget>-E<gt>B<appname>?(I<newName>)?
  39.  
  40. If I<newName> isn't specified, this method returns the name
  41. of the application (the name that may be used in B<send>
  42. commands to communicate with the application).
  43. If I<newName> is specified, then the name of the application
  44. is changed to I<newName>.
  45. If the given name is already in use, then a suffix of the form
  46. ``B< #2>'' or ``B< #3>'' is appended in order to make the name unique.
  47. The method's result is the name actually chosen.
  48. I<newName> should not start with a capital letter.
  49. This will interfere with L<option|Tk::option> processing, since names starting with
  50. capitals are assumed to be classes;  as a result, Tk may not
  51. be able to find some options for the application.
  52. If sends have been disabled by deleting the B<send> command,
  53. this command will reenable them and recreate the B<send>
  54. command.
  55.  
  56. =item I<$widget>-E<gt>B<atom>(I<name>)
  57.  
  58. Returns a decimal string giving the integer identifier for the
  59. atom whose name is I<name>.  If no atom exists with the name
  60. I<name> then a new one is created.
  61.  
  62. =item I<$widget>-E<gt>B<atomname>(I<id>)
  63.  
  64. Returns the textual name for the atom whose integer identifier is
  65. I<id>.
  66. This command is the inverse of the I<$widget>-E<gt>B<atom> command.
  67. It generates an error if no such atom exists.
  68.  
  69. =item I<$widget>-E<gt>B<bell>
  70.  
  71. This command rings the bell on the display for I<$widget> and
  72. returns an empty string.
  73. The command uses the current bell-related settings for the display, which
  74. may be modified with programs such as B<xset>.
  75.  
  76. This command also resets the screen saver for the screen.  Some
  77. screen savers will ignore this, but others will reset so that the
  78. screen becomes visible again.
  79.  
  80. =item I<$widget>-E<gt>B<Busy>?(?-recurse => 1?I<-option => value>?)?
  81.  
  82. This method B<configure>s a B<-cursor> option for I<$widget> and
  83. (if B<-recurse => 1> is specified) all its descendants. The cursor to
  84. be set may be passed as S<B<-cursor> => I<cursor>> or defaults to 'watch'.
  85. Additional B<configure> options are applied to I<$widget> only.
  86. It also adds a special tag B<'Busy'> to the B<bindtags> of the widgets so
  87. configured so that  B<KeyPress>, B<KeyRelease>, B<ButtonPress> and
  88. B<ButtonRelease> events are ignored (with press events generating a call to
  89. B<bell>). It then acquires a local B<grab> for I<$widget>.
  90. The state of the widgets and the grab is restored by a call to
  91. I<$widget>-E<gt>B<Unbusy>.
  92.  
  93.  
  94. =item I<$widget>-E<gt>B<cells>
  95.  
  96. Returns a decimal string giving the number of cells in the
  97. color map for I<$widget>.
  98.  
  99. =item I<$widget>-E<gt>B<children>
  100.  
  101. I<$widget->>B<children>
  102. Returns a list containing all the children
  103. of $widget.  The list is in stacking order, with the lowest
  104. window first.  Top-level windows are returned as children
  105. of their logical parents.
  106.  
  107. =item I<$widget>-E<gt>B<class>
  108.  
  109. Returns the class name for I<$widget>.
  110.  
  111. =item I<$widget>-E<gt>B<colormapfull>
  112.  
  113. Returns 1 if the colormap for I<$widget> is known to be full, 0
  114. otherwise.  The colormap for a window is ``known'' to be full if the last
  115. attempt to allocate a new color on that window failed and this
  116. application hasn't freed any colors in the colormap since the
  117. failed allocation.
  118.  
  119. =item I<$widget>-E<gt>B<ConfigSpecs>
  120.  
  121. Used to perform delegated option configuration for a mega-widget.    
  122. Returns, in Tk::Derived::ConfigSpecs notation (see L<Tk::ConfigSpecs>),
  123. all possible options for a widget. For example,
  124.  
  125.  $s = $self->Scale;
  126.  $self->ConfigSpecs(
  127.      $s->ConfigSpecs,
  128.      .... more ConfigSpecs specifications
  129.  );
  130.  
  131. returns a hash of all Tk::Scale options, delegated to $s - e.g. some
  132. representative examples:
  133.  
  134.  -bigincrement => [$s, bigIncrement, BigIncrement, 0, 0]
  135.  -digits       => [$s, digits, Digits, 0, 0]
  136.  -sliderlength => [$s, sliderLength, SliderLength, 10m, 30]
  137.  -troughcolor  => [$s, troughColor, Background, #c3c3c3, #c3c3c3]
  138.  
  139. This provides an easy means of populating a mega-widget's ConfigSpecs
  140. with initializers.
  141.  
  142. =item I<$widget>-E<gt>B<containing>(I<rootX,rootY>)
  143.  
  144. Returns the window containing the point given
  145. by I<rootX> and I<rootY>.
  146. I<RootX> and I<rootY> are specified in screen units (i.e.
  147. any form acceptable to B<Tk_GetPixels>) in the coordinate
  148. system of the root window (if a virtual-root window manager is in
  149. use then the coordinate system of the virtual root window is used).
  150. If no window in this application contains the point then an empty
  151. string is returned.
  152. In selecting the containing window, children are given higher priority
  153. than parents and among siblings the highest one in the stacking order is
  154. chosen.
  155.  
  156. =item I<$widget>-E<gt>B<depth>
  157.  
  158. Returns a decimal string giving the depth of I<$widget> (number
  159. of bits per pixel).
  160.  
  161. =item I<$widget>-E<gt>B<destroy>
  162.  
  163. This command deletes the window related to
  164. I<$widget>, plus all its descendants.
  165. If all the B<MainWindows> are deleted then the entire application
  166. will be destroyed.
  167.  
  168. The perl object I<$widget> continues to exist while references
  169. to it still exist, e.g. until variable goes out of scope.
  170. However any attempt to use Tk methods on the object will fail.
  171. B<Exists>(I<$widget>) will return false on such objects.
  172.  
  173. Note however that while a window exists for I<$widget> the
  174. perl object is maintained (due to "references" in perl/Tk internals)
  175. even though original variables may have gone out of scope.
  176. (Normally this is intuitive.)
  177.  
  178. =item B<Exists>(I<$widget>)
  179.  
  180. Returns 1 if there exists a window for I<$widget>, 0 if no such
  181. window exists.
  182.  
  183. =item I<$widget>-E<gt>B<font>(I<option>?, I<arg, arg, ...>?)
  184.  
  185. Create and inspect fonts. See L<Tk::Font> for further details.
  186.  
  187. =item I<$widget>-E<gt>B<fpixels>(I<number>)
  188.  
  189. Returns a floating-point value giving the number of pixels
  190. in I<$widget> corresponding to the distance given by I<number>.
  191. I<Number> may be specified in any of the forms acceptable
  192. to B<Tk_GetScreenMM>, such as ``2.0c'' or ``1i''.
  193. The return value may be fractional;  for an integer value, use
  194. I<$widget>-E<gt>B<pixels>.
  195.  
  196. =item I<$widget>-E<gt>B<Getimage>(I<name>)
  197.  
  198. Given I<name>, look for an image file with that base name and return
  199. a L<Tk::Image>.  File extensions are tried in this order: F<xpm>,
  200. F<gif>, F<ppm>, F<xbm> until a valid iamge is found.  If no image is
  201. found, try a builtin image with that name.
  202.  
  203. =item I<$widget>-E<gt>B<geometry>
  204.  
  205. Returns the geometry for I<$widget>, in the form
  206. I<width>B<x>I<height>B<+>I<x>B<+>I<y>.  All dimensions are
  207. in pixels.
  208.  
  209. =item I<$widget>-E<gt>B<height>
  210.  
  211. Returns a decimal string giving I<$widget>'s height in pixels.
  212. When a window is first created its height will be 1 pixel;  the
  213. height will eventually be changed by a geometry manager to fulfill
  214. the window's needs.
  215. If you need the true height immediately after creating a widget,
  216. invoke B<update> to force the geometry manager to arrange it,
  217. or use I<$widget>-E<gt>B<reqheight> to get the window's requested height
  218. instead of its actual height.
  219.  
  220. =item I<$widget>-E<gt>B<id>
  221.  
  222. Returns a hexadecimal string giving a low-level platform-specific
  223. identifier for $widget.  On Unix platforms, this is the X
  224. window identifier.  Under Windows, this is the Windows
  225. HWND.  On the Macintosh the value has no meaning outside Tk.
  226.  
  227. =item I<$widget>-E<gt>B<idletasks>
  228.  
  229. One of two methods which are used to bring the application ``up to date''
  230. by entering the event loop repeated until all pending events
  231. (including idle callbacks) have been processed.
  232.  
  233. If the B<idletasks> method is specified, then no new events or errors
  234. are processed; only idle callbacks are invoked. This causes operations
  235. that are normally deferred, such as display updates and window layout
  236. calculations, to be performed immediately.
  237.  
  238. The B<idletasks> command is useful in scripts where changes have been
  239. made to the application's state and you want those changes to appear
  240. on the display immediately, rather than waiting for the script to
  241. complete. Most display updates are performed as idle callbacks, so
  242. B<idletasks> will cause them to run. However, there are some kinds of
  243. updates that only happen in response to events, such as those
  244. triggered by window size changes; these updates will not occur in
  245. B<idletasks>.
  246.  
  247. =item I<$widget>-E<gt>B<interps>
  248.  
  249. Returns a list whose members are the names of all Tcl interpreters
  250. (e.g. all Tk-based applications) currently registered for
  251. a particular display.
  252. The return value refers
  253. to the display of I<$widget>.
  254.  
  255. =item I<$widget>-E<gt>B<ismapped>
  256.  
  257. Returns B<1> if I<$widget> is currently mapped, B<0> otherwise.
  258.  
  259. =item I<$widget->>B<lower>(?I<belowThis>?)
  260.  
  261. If the I<belowThis> argument is omitted then the command lowers
  262. $widget so that it is below all of its siblings in the stacking
  263. order (it will be obscured by any siblings that overlap it and
  264. will not obscure any siblings).
  265. If I<belowThis> is specified then it must be the path name of
  266. a window that is either a sibling of $widget or the descendant
  267. of a sibling of $widget.
  268. In this case the B<lower> command will insert
  269. $widget into the stacking order just below I<belowThis>
  270. (or the ancestor of I<belowThis> that is a sibling of $widget);
  271. this could end up either raising or lowering $widget.
  272.  
  273. =item I<$widget>-E<gt>B<MapWindow>
  274.  
  275. Cause I<$widget> to be "mapped" i.e. made visible on the display.
  276. May confuse the geometry manager (pack, grid, place, ...)
  277. that thinks it is managing the widget.
  278.  
  279. =item I<$widget>-E<gt>B<manager>
  280.  
  281. Returns the name of the geometry manager currently
  282. responsible for I<$widget>, or an empty string if I<$widget>
  283. isn't managed by any geometry manager.
  284. The name is usually the name of the method for the geometry
  285. manager, such as B<pack> or B<place>.
  286. If the geometry manager is a widget, such as canvases or text, the
  287. name is the widget's class command, such as B<canvas>.
  288.  
  289. =item I<$widget>-E<gt>B<name>
  290.  
  291. Returns I<$widget>'s name (i.e. its name within its parent, as opposed
  292. to its full path name).
  293. The command I<$mainwin>-E<gt>B<name> will return the name of the application.
  294.  
  295. =item I<$widget>-E<gt>B<OnDestroy>(I<callback>);
  296.  
  297. OnDestroy accepts a standard perl/Tk I<callback>.
  298. When the window associated with I<$widget> is destroyed then
  299. the callback is invoked. Unlike I<$widget->>bind('E<lt>DestroyE<gt>',...)
  300. the widgets methods are still available when I<callback> is executed,
  301. so (for example) a B<Text> widget can save its contents to a file.
  302.  
  303. OnDestroy was required for new B<after> mechanism.
  304.  
  305. =item I<$widget>-E<gt>B<parent>
  306.  
  307. Returns I<$widget>'s parent, or an empty string
  308. if I<$widget> is the main window of the application.
  309.  
  310. =item I<$widget>-E<gt>B<PathName>
  311.  
  312. Returns the tk path name of I<$widget>. (This is an import from the
  313. C interface.)
  314.  
  315. =item I<$widget>-E<gt>B<pathname>(I<id>)
  316.  
  317. Returns an object whose X identifier is I<id>.
  318. The identifier is looked up on the display of I<$widget>.
  319. I<Id> must be a decimal, hexadecimal, or octal integer and must
  320. correspond to a window in the invoking application, or an error
  321. occurs which can be trapped with C<eval { }> or C<Tk::catch { }>.
  322. If the window belongs to the application, but is not an object
  323. (for example wrapper windows, HList header, etc.) then C<undef>
  324. is returned.
  325.  
  326. =item I<$widget>-E<gt>B<pixels>(I<number>)
  327.  
  328. Returns the number of pixels in I<$widget> corresponding
  329. to the distance given by I<number>.
  330. I<Number> may be specified in any of the forms acceptable
  331. to B<Tk_GetPixels>, such as ``2.0c'' or ``1i''.
  332. The result is rounded to the nearest integer value;  for a
  333. fractional result, use I<$widget>-E<gt>B<fpixels>.
  334.  
  335. =item I<$widget>-E<gt>B<pointerx>
  336.  
  337. If the mouse pointer is on the same screen as I<$widget>, returns the
  338. pointer's x coordinate, measured in pixels in the screen's root window.
  339. If a virtual root window is in use on the screen, the position is
  340. measured in the virtual root.
  341. If the mouse pointer isn't on the same screen as I<$widget> then
  342. -1 is returned.
  343.  
  344. =item I<$widget>-E<gt>B<pointerxy>
  345.  
  346. If the mouse pointer is on the same screen as I<$widget>, returns a list
  347. with two elements, which are the pointer's x and y coordinates measured
  348. in pixels in the screen's root window.
  349. If a virtual root window is in use on the screen, the position
  350. is computed in the virtual root.
  351. If the mouse pointer isn't on the same screen as I<$widget> then
  352. both of the returned coordinates are -1.
  353.  
  354. =item I<$widget>-E<gt>B<pointery>
  355.  
  356. If the mouse pointer is on the same screen as I<$widget>, returns the
  357. pointer's y coordinate, measured in pixels in the screen's root window.
  358. If a virtual root window is in use on the screen, the position
  359. is computed in the virtual root.
  360. If the mouse pointer isn't on the same screen as I<$widget> then
  361. -1 is returned.
  362.  
  363. =item I<$widget>-E<gt>B<raise>(?I<aboveThis>?)
  364.  
  365. If the I<aboveThis> argument is omitted then the command raises
  366. $widget so that it is above all of its siblings in the stacking
  367. order (it will not be obscured by any siblings and will obscure
  368. any siblings that overlap it).
  369. If I<aboveThis> is specified then it must be the path name of
  370. a window that is either a sibling of $widget or the descendant
  371. of a sibling of $widget.
  372. In this case the B<raise> command will insert
  373. $widget into the stacking order just above I<aboveThis>
  374. (or the ancestor of I<aboveThis> that is a sibling of $widget);
  375. this could end up either raising or lowering $widget.
  376.  
  377. =item I<$widget>-E<gt>B<reqheight>
  378.  
  379. Returns a decimal string giving I<$widget>'s requested height,
  380. in pixels.  This is the value used by I<$widget>'s geometry
  381. manager to compute its geometry.
  382.  
  383. =item I<$widget>-E<gt>B<reqwidth>
  384.  
  385. Returns a decimal string giving I<$widget>'s requested width,
  386. in pixels.  This is the value used by I<$widget>'s geometry
  387. manager to compute its geometry.
  388.  
  389. =item I<$widget>-E<gt>B<rgb>(I<color>)
  390.  
  391. Returns a list containing three decimal values, which are the
  392. red, green, and blue intensities that correspond to I<color> in
  393. the window given by I<$widget>.  I<Color>
  394. may be specified in any of the forms acceptable for a color
  395. option.
  396.  
  397. =item I<$widget>-E<gt>B<rootx>
  398.  
  399. Returns a decimal string giving the x-coordinate, in the root
  400. window of the screen, of the
  401. upper-left corner of I<$widget>'s border (or I<$widget> if it
  402. has no border).
  403.  
  404. =item I<$widget>-E<gt>B<rooty>
  405.  
  406. Returns a decimal string giving the y-coordinate, in the root
  407. window of the screen, of the
  408. upper-left corner of I<$widget>'s border (or I<$widget> if it
  409. has no border).
  410.  
  411. =item B<scaling>
  412.  
  413. =item I<$widget>-E<gt>B<scaling>?(I<number>)?
  414.  
  415. Sets and queries the current scaling factor used by Tk to convert between
  416. physical units (for example, points, inches, or millimeters) and pixels.  The
  417. I<number> argument is a floating point number that specifies the number of
  418. pixels per point on $widget's display. If the I<number> argument is
  419. omitted, the current value of the scaling factor is returned.
  420.  
  421. A ``point'' is a unit of measurement equal to 1/72 inch.  A scaling factor
  422. of 1.0 corresponds to 1 pixel per point, which is equivalent to a standard
  423. 72 dpi monitor.  A scaling factor of 1.25 would mean 1.25 pixels per point,
  424. which is the setting for a 90 dpi monitor; setting the scaling factor to
  425. 1.25 on a 72 dpi monitor would cause everything in the application to be
  426. displayed 1.25 times as large as normal.  The initial value for the scaling
  427. factor is set when the application starts, based on properties of the
  428. installed monitor (as reported via the window system),
  429. but it can be changed at any time.  Measurements made
  430. after the scaling factor is changed will use the new scaling factor, but it
  431. is undefined whether existing widgets will resize themselves dynamically to
  432. accomodate the new scaling factor.
  433.  
  434. =item I<$widget>-E<gt>B<screen>
  435.  
  436. Returns the name of the screen associated with I<$widget>, in
  437. the form I<displayName>.I<screenIndex>.
  438.  
  439. =item I<$widget>-E<gt>B<screencells>
  440.  
  441. Returns a decimal string giving the number of cells in the default
  442. color map for I<$widget>'s screen.
  443.  
  444. =item I<$widget>-E<gt>B<screendepth>
  445.  
  446. Returns a decimal string giving the depth of the root window
  447. of I<$widget>'s screen (number of bits per pixel).
  448.  
  449. =item I<$widget>-E<gt>B<screenheight>
  450.  
  451. Returns a decimal string giving the height of I<$widget>'s screen,
  452. in pixels.
  453.  
  454. =item I<$widget>-E<gt>B<screenmmheight>
  455.  
  456. Returns a decimal string giving the height of I<$widget>'s screen,
  457. in millimeters.
  458.  
  459. =item I<$widget>-E<gt>B<screenmmwidth>
  460.  
  461. Returns a decimal string giving the width of I<$widget>'s screen,
  462. in millimeters.
  463.  
  464. =item I<$widget>-E<gt>B<screenvisual>
  465.  
  466. Returns one of the following strings to indicate the default visual
  467. class for I<$widget>'s screen: B<directcolor>, B<grayscale>,
  468. B<pseudocolor>, B<staticcolor>, B<staticgray>, or
  469. B<truecolor>.
  470.  
  471. =item I<$widget>-E<gt>B<screenwidth>
  472.  
  473. Returns a decimal string giving the width of I<$widget>'s screen,
  474. in pixels.
  475.  
  476. =item I<$widget>-E<gt>B<server>
  477.  
  478. Returns a string containing information about the server for
  479. I<$widget>'s display.  The exact format of this string may vary
  480. from platform to platform.  For X servers the string
  481. has the form ``B<X>I<major>B<R>I<minor vendor vendorVersion>''
  482. where I<major> and I<minor> are the version and revision
  483. numbers provided by the server (e.g., B<X11R5>), I<vendor>
  484. is the name of the vendor for the server, and I<vendorRelease>
  485. is an integer release number provided by the server.
  486.  
  487. =item I<$widget>-E<gt>B<toplevel>
  488.  
  489. Returns the reference of the top-level window containing I<$widget>.
  490.  
  491. =item I<$widget>-E<gt>B<UnmapWindow>
  492.  
  493. Cause I<$widget> to be "unmapped" i.e. removed from the display.
  494. This does for any widget what I<$widget>-E<gt>withdraw does for
  495. toplevel widgets. May confuse the geometry manager (pack, grid, place, ...)
  496. that thinks it is managing the widget.
  497.  
  498. =item I<$widget>-E<gt>B<update>
  499.  
  500. One of two methods which are used to bring the application ``up to date''
  501. by entering the event loop repeated until all pending events
  502. (including idle callbacks) have been processed.
  503.  
  504. The B<update> method is useful in scripts where you are performing a
  505. long-running computation but you still want the application to respond
  506. to events such as user interactions; if you occasionally call
  507. B<update> then user input will be processed during the next call to
  508. B<update>.
  509.  
  510. =item I<$widget>-E<gt>B<Unbusy>
  511.  
  512. Restores widget state after a call to  I<$widget>-E<gt>B<Busy>.
  513.  
  514. =item I<$widget>-E<gt>B<viewable>
  515.  
  516. Returns 1 if I<$widget> and all of its ancestors up through the
  517. nearest toplevel window are mapped.  Returns 0 if any of these
  518. windows are not mapped.
  519.  
  520. =item I<$widget>-E<gt>B<visual>
  521.  
  522. Returns one of the following strings to indicate the visual
  523. class for I<$widget>: B<directcolor>, B<grayscale>,
  524. B<pseudocolor>, B<staticcolor>, B<staticgray>, or
  525. B<truecolor>.
  526.  
  527. =item I<$widget>-E<gt>B<visualid>
  528.  
  529. Returns the X identifier for the visual for $widget.
  530.  
  531. =item I<$widget>-E<gt>B<visualsavailable>(?B<includeids>?)
  532.  
  533. Returns a list whose elements describe the visuals available for
  534. I<$widget>'s screen.
  535. Each element consists of a visual class followed by an integer depth.
  536. The class has the same form as returned by I<$widget>-E<gt>B<visual>.
  537. The depth gives the number of bits per pixel in the visual.
  538. In addition, if the B<includeids> argument is provided, then the
  539. depth is followed by the X identifier for the visual.
  540.  
  541. =item I<$widget>-E<gt>B<vrootheight>
  542.  
  543. Returns the height of the virtual root window associated with I<$widget>
  544. if there is one;  otherwise returns the height of I<$widget>'s screen.
  545.  
  546. =item I<$widget>-E<gt>B<vrootwidth>
  547.  
  548. Returns the width of the virtual root window associated with I<$widget>
  549. if there is one;  otherwise returns the width of I<$widget>'s screen.
  550.  
  551. =item I<$widget>-E<gt>B<vrootx>
  552.  
  553. Returns the x-offset of the virtual root window associated with I<$widget>,
  554. relative to the root window of its screen.
  555. This is normally either zero or negative.
  556. Returns 0 if there is no virtual root window for I<$widget>.
  557.  
  558. =item I<$widget>-E<gt>B<vrooty>
  559.  
  560. Returns the y-offset of the virtual root window associated with I<$widget>,
  561. relative to the root window of its screen.
  562. This is normally either zero or negative.
  563. Returns 0 if there is no virtual root window for I<$widget>.
  564.  
  565. =item I<$widget->>B<waitVariable>(\$I<name>)
  566.  
  567. =item I<$widget->>B<waitVisibility>
  568.  
  569. =item I<$widget->>B<waitWindow>
  570.  
  571. The B<tk wait> methods wait for one of several things to happen,
  572. then it returns without taking any other actions.
  573. The return value is always an empty string.
  574. B<waitVariable> expects a reference to a perl
  575. variable and the command waits for that variable to be modified.
  576. This form is typically used to wait for a user to finish interacting
  577. with a dialog which sets the variable as part (possibly final)
  578. part of the interaction.
  579. B<waitVisibility> waits for a change in I<$widget>'s
  580. visibility state (as indicated by the arrival of a VisibilityNotify
  581. event).  This form is typically used to wait for a newly-created
  582. window to appear on the screen before taking some action.
  583. B<waitWindow> waits for I<$widget> to be destroyed.
  584. This form is typically used to wait for a user to finish interacting
  585. with a dialog box before using the result of that interaction.
  586. Note that creating and destroying the window each time a dialog is required
  587. makes code modular but imposes overhead which can be avoided by B<withdrawing>
  588. the window instead and using B<waitVisibility>.
  589.  
  590. While the B<tk wait> methods are waiting they processes events in
  591. the normal fashion, so the application will continue to respond
  592. to user interactions.
  593. If an event handler invokes B<tkwait> again, the nested call
  594. to B<tkwait> must complete before the outer call can complete.
  595.  
  596. =item I<$widget>-E<gt>B<width>
  597.  
  598. Returns a decimal string giving I<$widget>'s width in pixels.
  599. When a window is first created its width will be 1 pixel;  the
  600. width will eventually be changed by a geometry manager to fulfill
  601. the window's needs.
  602. If you need the true width immediately after creating a widget,
  603. invoke B<update> to force the geometry manager to arrange it,
  604. or use I<$widget>-E<gt>B<reqwidth> to get the window's requested width
  605. instead of its actual width.
  606.  
  607. =item I<$widget>-E<gt>B<x>
  608.  
  609. Returns a decimal string giving the x-coordinate, in I<$widget>'s
  610. parent, of the upper-left corner of I<$widget>'s border (or I<$widget>
  611. if it has no border).
  612.  
  613. =item I<$widget>-E<gt>B<y>
  614.  
  615. Returns a decimal string giving the y-coordinate, in I<$widget>'s
  616. parent, of the
  617. upper-left corner of I<$widget>'s border (or I<$widget> if it
  618. has no border).
  619.  
  620. =back
  621.  
  622. =head1 CAVEATS
  623.  
  624. The above documentaion on generic methods is incomplete.
  625.  
  626. =head1 KEYWORDS
  627.  
  628. atom, children, class, geometry, height, identifier, information, interpreters,
  629. mapped, parent, path name, screen, virtual root, width, window
  630.  
  631. =cut
  632.  
  633.