.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Widget 3" .TH Widget 3 2023-07-25 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Tk::Widget \- Base class of all widgets .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 4 \& package Tk::Whatever; \& require Tk::Widget; \& @ISA = qw(Tk::Widget); \& Construct Tk::Widget \*(AqWhatever\*(Aq; \& \& sub Tk_cmd { \e&Tk::whatever } .Ve .PP \ \ \ \fR\f(CI$widget\fR\fI\fR\->\fImethod\fR(?\fIarg, arg, ...\fR?) .SH DESCRIPTION .IX Header "DESCRIPTION" The \fBTk::Widget\fR is an abstract base class for all Tk widgets. .PP Generic methods available to all widgets include the methods based on core \&\f(CW\*(C`winfo\*(C'\fR mechanism and are used to retrieve information about windows managed by Tk. They can take any of a number of different forms, depending on the \fImethod\fR. The legal forms are: .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBappname\fR?(\fInewName\fR)? 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBappname\fR?(\fInewName\fR)? 4 .IX Item "$widget->appname?(newName)?" If \fInewName\fR isn't specified, this method returns the name of the application (the name that may be used in \fBsend\fR commands to communicate with the application). If \fInewName\fR is specified, then the name of the application is changed to \fInewName\fR. If the given name is already in use, then a suffix of the form ``\fB #2\fR'' or ``\fB #3\fR'' is appended in order to make the name unique. The method's result is the name actually chosen. \&\fInewName\fR should not start with a capital letter. This will interfere with option processing, since names starting with capitals are assumed to be classes; as a result, Tk may not be able to find some options for the application. If sends have been disabled by deleting the \fBsend\fR command, this command will reenable them and recreate the \fBsend\fR command. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBatom\fR(\fIname\fR) 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBatom\fR(\fIname\fR) 4 .IX Item "$widget->atom(name)" Returns a decimal string giving the integer identifier for the atom whose name is \fIname\fR. If no atom exists with the name \&\fIname\fR then a new one is created. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBatomname\fR(\fIid\fR) 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBatomname\fR(\fIid\fR) 4 .IX Item "$widget->atomname(id)" Returns the textual name for the atom whose integer identifier is \&\fIid\fR. This command is the inverse of the \fR\f(CI$widget\fR\fI\fR\->\fBatom\fR command. It generates an error if no such atom exists. .ie n .IP "\fR\fI$widget\fR\fI\fR\->\fBbell\fR( ?\-nice? );" 4 .el .IP "\fR\f(CI$widget\fR\fI\fR\->\fBbell\fR( ?\-nice? );" 4 .IX Item "$widget->bell( ?-nice? );" This command rings the bell on the display for \fR\f(CI$widget\fR\fI\fR and returns an empty string. The command uses the current bell-related settings for the display, which may be modified with programs such as \fBxset\fR. .Sp If \fI\-nice\fR is not specified, this command also resets the screen saver for the screen. Some screen savers will ignore this, but others will reset so that the screen becomes visible again. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBbindDump\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBbindDump\fR 4 .IX Item "$widget->bindDump" This command returns a list of strings suitable for printing detailing binding information for a widget. It prints a widget's bindtags. For each binding tag it prints all the bindings, comprised of the event descriptor and the callback. Callback arguments are printed, and \fBTk::Ev\fR objects are expanded. .ie n .IP "\fR\fI$widget\fR\fI\fR\->\fBBusy\fR?(?\-recurse => 1?,\fI\-option\fR => \fIvalue\fR?)?" 4 .el .IP "\fR\f(CI$widget\fR\fI\fR\->\fBBusy\fR?(?\-recurse => 1?,\fI\-option\fR => \fIvalue\fR?)?" 4 .IX Item "$widget->Busy?(?-recurse => 1?,-option => value?)?" This method \fBconfigure\fRs a \fB\-cursor\fR option for \fR\f(CI$widget\fR\fI\fR and (if \fB\-recurse =\fR 1> is specified) all its descendants. The cursor to be set may be passed as \fB\-cursor\fR\ = \fIcursor\fR> or defaults to 'watch'. Additional \fBconfigure\fR options are applied to \fI\fR\f(CI$widget\fR\fI\fR only. It also adds a special tag \fB'Busy'\fR to the \fBbindtags\fR of the widgets so configured so that \fBKeyPress\fR, \fBKeyRelease\fR, \fBButtonPress\fR and \&\fBButtonRelease\fR events are ignored (with press events generating a call to \&\fBbell\fR). It then acquires a local \fBgrab\fR for \fI\fR\f(CI$widget\fR\fI\fR. The state of the widgets and the grab is restored by a call to \&\fI\fR\f(CI$widget\fR\fI\fR\->\fBUnbusy\fR. .ie n .IP "\fR\fI$widget\fR\fI\fR\->\fBcaret\fR( ?\-x => \fIx\fR?, ?\-y => \fIy\fR?, ?\-height => \fIheight\fR? );" 4 .el .IP "\fR\f(CI$widget\fR\fI\fR\->\fBcaret\fR( ?\-x => \fIx\fR?, ?\-y => \fIy\fR?, ?\-height => \fIheight\fR? );" 4 .IX Item "$widget->caret( ?-x => x?, ?-y => y?, ?-height => height? );" Sets and queries the caret location for the display of the specified Tk window window. The caret is the per-display cursor location used for indicating global focus (e.g. to comply with Microsoft Accessibility guidelines), as well as for location of the over-the-spot XIM (X Input Methods) or Windows IME windows. If no options are specified, the last values used for setting the caret are return in option-value pair format. \-x and \-y represent window-relative coordinates, and \-height is the height of the current cursor location, or the height of the specified window if none is given. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBcells\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBcells\fR 4 .IX Item "$widget->cells" Returns a decimal string giving the number of cells in the color map for \fR\f(CI$widget\fR\fI\fR. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBchildren\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBchildren\fR 4 .IX Item "$widget->children" \&\fR\f(CI$widget\fR\fI\-\fR>\fBchildren\fR Returns a list containing all the children of \f(CW$widget\fR. The list is in stacking order, with the lowest window first. Top-level windows are returned as children of their logical parents. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBclass\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBclass\fR 4 .IX Item "$widget->class" Returns the class name for \fR\f(CI$widget\fR\fI\fR. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBcolormapfull\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBcolormapfull\fR 4 .IX Item "$widget->colormapfull" Returns 1 if the colormap for \fR\f(CI$widget\fR\fI\fR is known to be full, 0 otherwise. The colormap for a window is ``known'' to be full if the last attempt to allocate a new color on that window failed and this application hasn't freed any colors in the colormap since the failed allocation. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBConfigSpecs\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBConfigSpecs\fR 4 .IX Item "$widget->ConfigSpecs" Used to perform delegated option configuration for a mega-widget. Returns, in Tk::Derived::ConfigSpecs notation (see Tk::ConfigSpecs), all possible options for a widget. For example, .Sp .Vb 5 \& $s = $self\->Scale; \& $self\->ConfigSpecs( \& $s\->ConfigSpecs, \& .... more ConfigSpecs specifications \& ); .Ve .Sp returns a hash of all Tk::Scale options, delegated to \f(CW$s\fR \- e.g. some representative examples: .Sp .Vb 4 \& \-bigincrement => [$s, bigIncrement, BigIncrement, 0, 0] \& \-digits => [$s, digits, Digits, 0, 0] \& \-sliderlength => [$s, sliderLength, SliderLength, 10m, 30] \& \-troughcolor => [$s, troughColor, Background, #c3c3c3, #c3c3c3] .Ve .Sp This provides an easy means of populating a mega-widget's ConfigSpecs with initializers. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBcontaining\fR(\fIrootX,rootY\fR) 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBcontaining\fR(\fIrootX,rootY\fR) 4 .IX Item "$widget->containing(rootX,rootY)" Returns the window containing the point given by \fIrootX\fR and \fIrootY\fR. \&\fIRootX\fR and \fIrootY\fR are specified in screen units (i.e. any form acceptable to \fBTk_GetPixels\fR) in the coordinate system of the root window (if a virtual-root window manager is in use then the coordinate system of the virtual root window is used). If no window in this application contains the point then an empty string is returned. In selecting the containing window, children are given higher priority than parents and among siblings the highest one in the stacking order is chosen. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBdepth\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBdepth\fR 4 .IX Item "$widget->depth" Returns a decimal string giving the depth of \fR\f(CI$widget\fR\fI\fR (number of bits per pixel). .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBdestroy\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBdestroy\fR 4 .IX Item "$widget->destroy" This command deletes the window related to \&\fR\f(CI$widget\fR\fI\fR, plus all its descendants. If all the \fBMainWindows\fR are deleted then the entire application will be destroyed. .Sp The perl object \fR\f(CI$widget\fR\fI\fR continues to exist while references to it still exist, e.g. until variable goes out of scope. However any attempt to use Tk methods on the object will fail. \&\fBExists\fR(\fI\fR\f(CI$widget\fR\fI\fR) will return false on such objects. .Sp Note however that while a window exists for \fR\f(CI$widget\fR\fI\fR the perl object is maintained (due to "references" in perl/Tk internals) even though original variables may have gone out of scope. (Normally this is intuitive.) .ie n .IP \fBExists\fR(\fR\fI$widget\fR\fI\fR) 4 .el .IP \fBExists\fR(\fR\f(CI$widget\fR\fI\fR) 4 .IX Item "Exists($widget)" Returns 1 if there exists a window for \fR\f(CI$widget\fR\fI\fR, 0 if no such window exists. .ie n .IP "\fR\fI$widget\fR\fI\fR\->\fBfont\fR(\fIoption\fR?, \fIarg, arg, ...\fR?)" 4 .el .IP "\fR\f(CI$widget\fR\fI\fR\->\fBfont\fR(\fIoption\fR?, \fIarg, arg, ...\fR?)" 4 .IX Item "$widget->font(option?, arg, arg, ...?)" Create and inspect fonts. See Tk::Font for further details. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBfpixels\fR(\fInumber\fR) 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBfpixels\fR(\fInumber\fR) 4 .IX Item "$widget->fpixels(number)" Returns a floating-point value giving the number of pixels in \fR\f(CI$widget\fR\fI\fR corresponding to the distance given by \fInumber\fR. \&\fINumber\fR may be specified in any of the forms acceptable to \fBTk_GetScreenMM\fR, such as ``2.0c'' or ``1i''. The return value may be fractional; for an integer value, use \&\fI\fR\f(CI$widget\fR\fI\fR\->\fBpixels\fR. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBGetimage\fR(\fIname\fR) 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBGetimage\fR(\fIname\fR) 4 .IX Item "$widget->Getimage(name)" Given \fIname\fR, look for an image file with that base name and return a Tk::Image. File extensions are tried in this order: \fIxpm\fR, \&\fIgif\fR, \fIppm\fR, \fIxbm\fR until a valid iamge is found. If no image is found, try a builtin image with that name. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBgeometry\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBgeometry\fR 4 .IX Item "$widget->geometry" Returns the geometry for \fR\f(CI$widget\fR\fI\fR, in the form \&\fIwidth\fR\fBx\fR\fIheight\fR\fB+\fR\fIx\fR\fB+\fR\fIy\fR. All dimensions are in pixels. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBheight\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBheight\fR 4 .IX Item "$widget->height" Returns a decimal string giving \fR\f(CI$widget\fR\fI\fR's height in pixels. When a window is first created its height will be 1 pixel; the height will eventually be changed by a geometry manager to fulfill the window's needs. If you need the true height immediately after creating a widget, invoke \fBupdate\fR to force the geometry manager to arrange it, or use \fI\fR\f(CI$widget\fR\fI\fR\->\fBreqheight\fR to get the window's requested height instead of its actual height. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBid\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBid\fR 4 .IX Item "$widget->id" Returns a hexadecimal string giving a low-level platform-specific identifier for \f(CW$widget\fR. On Unix platforms, this is the X window identifier. Under Windows, this is the Windows HWND. On the Macintosh the value has no meaning outside Tk. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBidletasks\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBidletasks\fR 4 .IX Item "$widget->idletasks" One of two methods which are used to bring the application ``up to date'' by entering the event loop repeated until all pending events (including idle callbacks) have been processed. .Sp If the \fBidletasks\fR method is specified, then no new events or errors are processed; only idle callbacks are invoked. This causes operations that are normally deferred, such as display updates and window layout calculations, to be performed immediately. .Sp The \fBidletasks\fR command is useful in scripts where changes have been made to the application's state and you want those changes to appear on the display immediately, rather than waiting for the script to complete. Most display updates are performed as idle callbacks, so \&\fBidletasks\fR will cause them to run. However, there are some kinds of updates that only happen in response to events, such as those triggered by window size changes; these updates will not occur in \&\fBidletasks\fR. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBinterps\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBinterps\fR 4 .IX Item "$widget->interps" Returns a list whose members are the names of all Tcl interpreters (e.g. all Tk-based applications) currently registered for a particular display. The return value refers to the display of \fR\f(CI$widget\fR\fI\fR. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBismapped\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBismapped\fR 4 .IX Item "$widget->ismapped" Returns \fB1\fR if \fR\f(CI$widget\fR\fI\fR is currently mapped, \fB0\fR otherwise. .ie n .IP \fR\fI$widget\fR\fI\-\fR>\fBlower\fR(?\fIbelowThis\fR?) 4 .el .IP \fR\f(CI$widget\fR\fI\-\fR>\fBlower\fR(?\fIbelowThis\fR?) 4 .IX Item "$widget->lower(?belowThis?)" If the \fIbelowThis\fR argument is omitted then the command lowers \&\f(CW$widget\fR so that it is below all of its siblings in the stacking order (it will be obscured by any siblings that overlap it and will not obscure any siblings). If \fIbelowThis\fR is specified then it must be the path name of a window that is either a sibling of \f(CW$widget\fR or the descendant of a sibling of \f(CW$widget\fR. In this case the \fBlower\fR command will insert \&\f(CW$widget\fR into the stacking order just below \fIbelowThis\fR (or the ancestor of \fIbelowThis\fR that is a sibling of \f(CW$widget\fR); this could end up either raising or lowering \f(CW$widget\fR. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBMapWindow\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBMapWindow\fR 4 .IX Item "$widget->MapWindow" Cause \fR\f(CI$widget\fR\fI\fR to be "mapped" i.e. made visible on the display. May confuse the geometry manager (pack, grid, place, ...) that thinks it is managing the widget. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBmanager\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBmanager\fR 4 .IX Item "$widget->manager" Returns the name of the geometry manager currently responsible for \fR\f(CI$widget\fR\fI\fR, or an empty string if \fI\fR\f(CI$widget\fR\fI\fR isn't managed by any geometry manager. The name is usually the name of the method for the geometry manager, such as \fBpack\fR or \fBplace\fR. If the geometry manager is a widget, such as canvases or text, the name is the widget's class command, such as \fBcanvas\fR. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBname\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBname\fR 4 .IX Item "$widget->name" Returns \fR\f(CI$widget\fR\fI\fR's name (i.e. its name within its parent, as opposed to its full path name). The command \fI\fR\f(CI$mainwin\fR\fI\fR\->\fBname\fR will return the name of the application. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBOnDestroy\fR(\fIcallback\fR); 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBOnDestroy\fR(\fIcallback\fR); 4 .IX Item "$widget->OnDestroy(callback);" OnDestroy accepts a standard perl/Tk \fIcallback\fR. When the window associated with \fR\f(CI$widget\fR\fI\fR is destroyed then the callback is invoked. Unlike \fI\fR\f(CI$widget\fR\fI\-\fR>bind('',...) the widgets methods are still available when \fIcallback\fR is executed, so (for example) a \fBText\fR widget can save its contents to a file. .Sp OnDestroy was required for new \fBafter\fR mechanism. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBparent\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBparent\fR 4 .IX Item "$widget->parent" Returns \fR\f(CI$widget\fR\fI\fR's parent, or an empty string if \fI\fR\f(CI$widget\fR\fI\fR is the main window of the application. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBPathName\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBPathName\fR 4 .IX Item "$widget->PathName" Returns the Tk path name of \fR\f(CI$widget\fR\fI\fR. This is the inverse of the "Widget" method. (This is an import from the C interface.) .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBpathname\fR(\fIid\fR) 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBpathname\fR(\fIid\fR) 4 .IX Item "$widget->pathname(id)" Returns an object whose X identifier is \fIid\fR. The identifier is looked up on the display of \fR\f(CI$widget\fR\fI\fR. \&\fIId\fR must be a decimal, hexadecimal, or octal integer and must correspond to a window in the invoking application, or an error occurs which can be trapped with \f(CW\*(C`eval { }\*(C'\fR or \f(CW\*(C`Tk::catch { }\*(C'\fR. If the window belongs to the application, but is not an object (for example wrapper windows, HList header, etc.) then \f(CW\*(C`undef\*(C'\fR is returned. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBpixels\fR(\fInumber\fR) 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBpixels\fR(\fInumber\fR) 4 .IX Item "$widget->pixels(number)" Returns the number of pixels in \fR\f(CI$widget\fR\fI\fR corresponding to the distance given by \fInumber\fR. \&\fINumber\fR may be specified in any of the forms acceptable to \fBTk_GetPixels\fR, such as ``2.0c'' or ``1i''. The result is rounded to the nearest integer value; for a fractional result, use \fI\fR\f(CI$widget\fR\fI\fR\->\fBfpixels\fR. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBpointerx\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBpointerx\fR 4 .IX Item "$widget->pointerx" If the mouse pointer is on the same screen as \fR\f(CI$widget\fR\fI\fR, returns the pointer's x coordinate, measured in pixels in the screen's root window. If a virtual root window is in use on the screen, the position is measured in the virtual root. If the mouse pointer isn't on the same screen as \fI\fR\f(CI$widget\fR\fI\fR then \&\-1 is returned. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBpointerxy\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBpointerxy\fR 4 .IX Item "$widget->pointerxy" If the mouse pointer is on the same screen as \fR\f(CI$widget\fR\fI\fR, returns a list with two elements, which are the pointer's x and y coordinates measured in pixels in the screen's root window. If a virtual root window is in use on the screen, the position is computed in the virtual root. If the mouse pointer isn't on the same screen as \fI\fR\f(CI$widget\fR\fI\fR then both of the returned coordinates are \-1. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBpointery\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBpointery\fR 4 .IX Item "$widget->pointery" If the mouse pointer is on the same screen as \fR\f(CI$widget\fR\fI\fR, returns the pointer's y coordinate, measured in pixels in the screen's root window. If a virtual root window is in use on the screen, the position is computed in the virtual root. If the mouse pointer isn't on the same screen as \fI\fR\f(CI$widget\fR\fI\fR then \&\-1 is returned. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBraise\fR(?\fIaboveThis\fR?) 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBraise\fR(?\fIaboveThis\fR?) 4 .IX Item "$widget->raise(?aboveThis?)" If the \fIaboveThis\fR argument is omitted then the command raises \&\f(CW$widget\fR so that it is above all of its siblings in the stacking order (it will not be obscured by any siblings and will obscure any siblings that overlap it). If \fIaboveThis\fR is specified then it must be the path name of a window that is either a sibling of \f(CW$widget\fR or the descendant of a sibling of \f(CW$widget\fR. In this case the \fBraise\fR command will insert \&\f(CW$widget\fR into the stacking order just above \fIaboveThis\fR (or the ancestor of \fIaboveThis\fR that is a sibling of \f(CW$widget\fR); this could end up either raising or lowering \f(CW$widget\fR. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBreqheight\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBreqheight\fR 4 .IX Item "$widget->reqheight" Returns a decimal string giving \fR\f(CI$widget\fR\fI\fR's requested height, in pixels. This is the value used by \fI\fR\f(CI$widget\fR\fI\fR's geometry manager to compute its geometry. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBreqwidth\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBreqwidth\fR 4 .IX Item "$widget->reqwidth" Returns a decimal string giving \fR\f(CI$widget\fR\fI\fR's requested width, in pixels. This is the value used by \fI\fR\f(CI$widget\fR\fI\fR's geometry manager to compute its geometry. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBrgb\fR(\fIcolor\fR) 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBrgb\fR(\fIcolor\fR) 4 .IX Item "$widget->rgb(color)" Returns a list containing three decimal values, which are the red, green, and blue intensities that correspond to \fIcolor\fR in the window given by \fR\f(CI$widget\fR\fI\fR. \fIColor\fR may be specified in any of the forms acceptable for a color option. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBrootx\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBrootx\fR 4 .IX Item "$widget->rootx" Returns a decimal string giving the x\-coordinate, in the root window of the screen, of the upper-left corner of \fR\f(CI$widget\fR\fI\fR's border (or \fI\fR\f(CI$widget\fR\fI\fR if it has no border). .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBrooty\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBrooty\fR 4 .IX Item "$widget->rooty" Returns a decimal string giving the y\-coordinate, in the root window of the screen, of the upper-left corner of \fR\f(CI$widget\fR\fI\fR's border (or \fI\fR\f(CI$widget\fR\fI\fR if it has no border). .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBscaling\fR?(\fInumber\fR)? 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBscaling\fR?(\fInumber\fR)? 4 .IX Item "$widget->scaling?(number)?" Sets and queries the current scaling factor used by Tk to convert between physical units (for example, points, inches, or millimeters) and pixels. The \&\fInumber\fR argument is a floating point number that specifies the number of pixels per point on \f(CW$widget\fR's display. If the \fInumber\fR argument is omitted, the current value of the scaling factor is returned. .Sp A ``point'' is a unit of measurement equal to 1/72 inch. A scaling factor of 1.0 corresponds to 1 pixel per point, which is equivalent to a standard 72 dpi monitor. A scaling factor of 1.25 would mean 1.25 pixels per point, which is the setting for a 90 dpi monitor; setting the scaling factor to 1.25 on a 72 dpi monitor would cause everything in the application to be displayed 1.25 times as large as normal. The initial value for the scaling factor is set when the application starts, based on properties of the installed monitor (as reported via the window system), but it can be changed at any time. Measurements made after the scaling factor is changed will use the new scaling factor, but it is undefined whether existing widgets will resize themselves dynamically to accomodate the new scaling factor. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBscreen\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBscreen\fR 4 .IX Item "$widget->screen" Returns the name of the screen associated with \fR\f(CI$widget\fR\fI\fR, in the form \fIdisplayName\fR.\fIscreenIndex\fR. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBscreencells\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBscreencells\fR 4 .IX Item "$widget->screencells" Returns a decimal string giving the number of cells in the default color map for \fR\f(CI$widget\fR\fI\fR's screen. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBscreendepth\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBscreendepth\fR 4 .IX Item "$widget->screendepth" Returns a decimal string giving the depth of the root window of \fR\f(CI$widget\fR\fI\fR's screen (number of bits per pixel). .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBscreenheight\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBscreenheight\fR 4 .IX Item "$widget->screenheight" Returns a decimal string giving the height of \fR\f(CI$widget\fR\fI\fR's screen, in pixels. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBscreenmmheight\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBscreenmmheight\fR 4 .IX Item "$widget->screenmmheight" Returns a decimal string giving the height of \fR\f(CI$widget\fR\fI\fR's screen, in millimeters. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBscreenmmwidth\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBscreenmmwidth\fR 4 .IX Item "$widget->screenmmwidth" Returns a decimal string giving the width of \fR\f(CI$widget\fR\fI\fR's screen, in millimeters. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBscreenvisual\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBscreenvisual\fR 4 .IX Item "$widget->screenvisual" Returns one of the following strings to indicate the default visual class for \fR\f(CI$widget\fR\fI\fR's screen: \fBdirectcolor\fR, \fBgrayscale\fR, \&\fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or \&\fBtruecolor\fR. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBscreenwidth\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBscreenwidth\fR 4 .IX Item "$widget->screenwidth" Returns a decimal string giving the width of \fR\f(CI$widget\fR\fI\fR's screen, in pixels. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBserver\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBserver\fR 4 .IX Item "$widget->server" Returns a string containing information about the server for \&\fR\f(CI$widget\fR\fI\fR's display. The exact format of this string may vary from platform to platform. For X servers the string has the form ``\fBX\fR\fImajor\fR\fBR\fR\fIminor vendor vendorVersion\fR'' where \fImajor\fR and \fIminor\fR are the version and revision numbers provided by the server (e.g., \fBX11R5\fR), \fIvendor\fR is the name of the vendor for the server, and \fIvendorRelease\fR is an integer release number provided by the server. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBtoplevel\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBtoplevel\fR 4 .IX Item "$widget->toplevel" Returns the reference of the top-level window containing \fR\f(CI$widget\fR\fI\fR. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBUnbusy\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBUnbusy\fR 4 .IX Item "$widget->Unbusy" Restores widget state after a call to \fR\f(CI$widget\fR\fI\fR\->\fBBusy\fR. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBUnmapWindow\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBUnmapWindow\fR 4 .IX Item "$widget->UnmapWindow" Cause \fR\f(CI$widget\fR\fI\fR to be "unmapped" i.e. removed from the display. This does for any widget what \fI\fR\f(CI$widget\fR\fI\fR\->withdraw does for toplevel widgets. May confuse the geometry manager (pack, grid, place, ...) that thinks it is managing the widget. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBupdate\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBupdate\fR 4 .IX Item "$widget->update" One of two methods which are used to bring the application ``up to date'' by entering the event loop repeated until all pending events (including idle callbacks) have been processed. .Sp The \fBupdate\fR method is useful in scripts where you are performing a long-running computation but you still want the application to respond to events such as user interactions; if you occasionally call \&\fBupdate\fR then user input will be processed during the next call to \&\fBupdate\fR. .ie n .IP "\fR\fI$widget\fR\fI\fR\->\fBuseinputmethods\fR( ?\fIboolean\fR? )" 4 .el .IP "\fR\f(CI$widget\fR\fI\fR\->\fBuseinputmethods\fR( ?\fIboolean\fR? )" 4 .IX Item "$widget->useinputmethods( ?boolean? )" Sets and queries the state of whether Tk should use XIM (X Input Methods) for filtering events. The resulting state is returned. XIM is used in some locales (ie: Japanese, Korean), to handle special input devices. This feature is only significant on X. If XIM support is not available, this will always return 0. If the boolean argument is omitted, the current state is returned. This is turned on by default for the main display. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBviewable\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBviewable\fR 4 .IX Item "$widget->viewable" Returns 1 if \fR\f(CI$widget\fR\fI\fR and all of its ancestors up through the nearest toplevel window are mapped. Returns 0 if any of these windows are not mapped. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBvisual\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBvisual\fR 4 .IX Item "$widget->visual" Returns one of the following strings to indicate the visual class for \fR\f(CI$widget\fR\fI\fR: \fBdirectcolor\fR, \fBgrayscale\fR, \&\fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or \&\fBtruecolor\fR. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBvisualid\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBvisualid\fR 4 .IX Item "$widget->visualid" Returns the X identifier for the visual for \f(CW$widget\fR. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBvisualsavailable\fR(?\fBincludeids\fR?) 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBvisualsavailable\fR(?\fBincludeids\fR?) 4 .IX Item "$widget->visualsavailable(?includeids?)" Returns a list whose elements describe the visuals available for \&\fR\f(CI$widget\fR\fI\fR's screen. Each element consists of a visual class followed by an integer depth. The class has the same form as returned by \fI\fR\f(CI$widget\fR\fI\fR\->\fBvisual\fR. The depth gives the number of bits per pixel in the visual. In addition, if the \fBincludeids\fR argument is provided, then the depth is followed by the X identifier for the visual. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBvrootheight\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBvrootheight\fR 4 .IX Item "$widget->vrootheight" Returns the height of the virtual root window associated with \fR\f(CI$widget\fR\fI\fR if there is one; otherwise returns the height of \fI\fR\f(CI$widget\fR\fI\fR's screen. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBvrootwidth\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBvrootwidth\fR 4 .IX Item "$widget->vrootwidth" Returns the width of the virtual root window associated with \fR\f(CI$widget\fR\fI\fR if there is one; otherwise returns the width of \fI\fR\f(CI$widget\fR\fI\fR's screen. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBvrootx\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBvrootx\fR 4 .IX Item "$widget->vrootx" Returns the x\-offset of the virtual root window associated with \fR\f(CI$widget\fR\fI\fR, relative to the root window of its screen. This is normally either zero or negative. Returns 0 if there is no virtual root window for \fI\fR\f(CI$widget\fR\fI\fR. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBvrooty\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBvrooty\fR 4 .IX Item "$widget->vrooty" Returns the y\-offset of the virtual root window associated with \fR\f(CI$widget\fR\fI\fR, relative to the root window of its screen. This is normally either zero or negative. Returns 0 if there is no virtual root window for \fI\fR\f(CI$widget\fR\fI\fR. .ie n .IP \fR\fI$widget\fR\fI\-\fR>\fBwaitVariable\fR(\e$\fIname\fR) 4 .el .IP \fR\f(CI$widget\fR\fI\-\fR>\fBwaitVariable\fR(\e$\fIname\fR) 4 .IX Item "$widget->waitVariable($name)" .PD 0 .ie n .IP \fR\fI$widget\fR\fI\-\fR>\fBwaitVisibility\fR 4 .el .IP \fR\f(CI$widget\fR\fI\-\fR>\fBwaitVisibility\fR 4 .IX Item "$widget->waitVisibility" .ie n .IP \fR\fI$widget\fR\fI\-\fR>\fBwaitWindow\fR 4 .el .IP \fR\f(CI$widget\fR\fI\-\fR>\fBwaitWindow\fR 4 .IX Item "$widget->waitWindow" .PD The \fBtk wait\fR methods wait for one of several things to happen, then it returns without taking any other actions. The return value is always an empty string. \&\fBwaitVariable\fR expects a reference to a perl variable and the command waits for that variable to be modified. This form is typically used to wait for a user to finish interacting with a dialog which sets the variable as part (possibly final) part of the interaction. \&\fBwaitVisibility\fR waits for a change in \fR\f(CI$widget\fR\fI\fR's visibility state (as indicated by the arrival of a VisibilityNotify event). This form is typically used to wait for a newly-created window to appear on the screen before taking some action. \&\fBwaitWindow\fR waits for \fI\fR\f(CI$widget\fR\fI\fR to be destroyed. This form is typically used to wait for a user to finish interacting with a dialog box before using the result of that interaction. Note that creating and destroying the window each time a dialog is required makes code modular but imposes overhead which can be avoided by \fBwithdrawing\fR the window instead and using \fBwaitVisibility\fR. .Sp While the \fBtk wait\fR methods are waiting they processes events in the normal fashion, so the application will continue to respond to user interactions. If an event handler invokes \fBtkwait\fR again, the nested call to \fBtkwait\fR must complete before the outer call can complete. .ie n .IP "\fR\fI$widget\fR\fI\fR\->\fBWalk\fR(\fIproc\fR?, \fIarg, ...\fR?)" 4 .el .IP "\fR\f(CI$widget\fR\fI\fR\->\fBWalk\fR(\fIproc\fR?, \fIarg, ...\fR?)" 4 .IX Item "$widget->Walk(proc?, arg, ...?)" Traverse a widget hierarchy starting at \fR\f(CI$widget\fR\fI\fR while executing the subroutine \fIproc\fR to every visited widget. The arguments \fIarg, ...\fR are supplied to the subroutine. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBWidget\fR(\fIpathname\fR) 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBWidget\fR(\fIpathname\fR) 4 .IX Item "$widget->Widget(pathname)" Returns the widget reference for the given Tk path name, or \f(CW\*(C`undef\*(C'\fR if the path name does not match a Tk widget. This is the inverse of the "PathName" method. (This is an import from the C interface.) .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBwidth\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBwidth\fR 4 .IX Item "$widget->width" Returns a decimal string giving \fR\f(CI$widget\fR\fI\fR's width in pixels. When a window is first created its width will be 1 pixel; the width will eventually be changed by a geometry manager to fulfill the window's needs. If you need the true width immediately after creating a widget, invoke \fBupdate\fR to force the geometry manager to arrange it, or use \fI\fR\f(CI$widget\fR\fI\fR\->\fBreqwidth\fR to get the window's requested width instead of its actual width. .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBwindowingsystem\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBwindowingsystem\fR 4 .IX Item "$widget->windowingsystem" Returns the current Tk windowing system, one of \fBx11\fR (X11\-based), \&\fBwin32\fR (MS Windows), \fBclassic\fR (Mac OS Classic), or \fBaqua\fR (Mac OS X Aqua). .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBx\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBx\fR 4 .IX Item "$widget->x" Returns a decimal string giving the x\-coordinate, in \fR\f(CI$widget\fR\fI\fR's parent, of the upper-left corner of \fI\fR\f(CI$widget\fR\fI\fR's border (or \fI\fR\f(CI$widget\fR\fI\fR if it has no border). .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBy\fR 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBy\fR 4 .IX Item "$widget->y" Returns a decimal string giving the y\-coordinate, in \fR\f(CI$widget\fR\fI\fR's parent, of the upper-left corner of \fI\fR\f(CI$widget\fR\fI\fR's border (or \fI\fR\f(CI$widget\fR\fI\fR if it has no border). .SH CAVEATS .IX Header "CAVEATS" The above documentaion on generic methods is incomplete. .SH KEYWORDS .IX Header "KEYWORDS" atom, children, class, geometry, height, identifier, information, interpreters, mapped, parent, path name, screen, virtual root, width, window