home *** CD-ROM | disk | FTP | other *** search
Wrap
wwwwmmmm((((nnnn)))) TTTTkkkk (((( )))) wwwwmmmm((((nnnn)))) _________________________________________________________________ NNNNAAAAMMMMEEEE wm - Communicate with window manager SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS wwwwmmmm _o_p_t_i_o_n _w_i_n_d_o_w ?_a_r_g_s? _________________________________________________________________ DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN The wwwwmmmm command is used to interact with window managers in order to control such things as the title for a window, its geometry, or the increments in terms of which it may be resized. The wwwwmmmm command can take any of a number of different forms, depending on the _o_p_t_i_o_n argument. All of the forms expect at least one additional argument, _w_i_n_d_o_w, which must be the path name of a top-level window. The legal forms for the wwwwmmmm command are: wwwwmmmm aaaassssppppeeeecccctttt _w_i_n_d_o_w ?_m_i_n_N_u_m_e_r _m_i_n_D_e_n_o_m _m_a_x_N_u_m_e_r _m_a_x_D_e_n_o_m? If _m_i_n_N_u_m_e_r, _m_i_n_D_e_n_o_m, _m_a_x_N_u_m_e_r, and _m_a_x_D_e_n_o_m are all specified, then they will be passed to the window manager and the window manager should use them to enforce a range of acceptable aspect ratios for _w_i_n_d_o_w. The aspect ratio of _w_i_n_d_o_w (width/length) will be constrained to lie between _m_i_n_N_u_m_e_r/_m_i_n_D_e_n_o_m and _m_a_x_N_u_m_e_r/_m_a_x_D_e_n_o_m. If _m_i_n_N_u_m_e_r etc. are all specified as empty strings, then any existing aspect ratio restrictions are removed. If _m_i_n_N_u_m_e_r etc. are specified, then the command returns an empty string. Otherwise, it returns a Tcl list containing four elements, which are the current values of _m_i_n_N_u_m_e_r, _m_i_n_D_e_n_o_m, _m_a_x_N_u_m_e_r, and _m_a_x_D_e_n_o_m (if no aspect restrictions are in effect, then an empty string is returned). wwwwmmmm cccclllliiiieeeennnntttt _w_i_n_d_o_w ?_n_a_m_e? If _n_a_m_e is specified, this command stores _n_a_m_e (which | should be the name of the host on which the application | is executing) in _w_i_n_d_o_w's WWWWMMMM____CCCCLLLLIIIIEEEENNNNTTTT____MMMMAAAACCCCHHHHIIIINNNNEEEE property | for use by the window manager or session manager. The | command returns an empty string in this case. If _n_a_m_e | isn't specified, the command returns the last name set | in a wwwwmmmm cccclllliiiieeeennnntttt command for _w_i_n_d_o_w. If _n_a_m_e is | specified as an empty string, the command deletes the | WWWWMMMM____CCCCLLLLIIIIEEEENNNNTTTT____MMMMAAAACCCCHHHHIIIINNNNEEEE property from _w_i_n_d_o_w. | wwwwmmmm ccccoooommmmmmmmaaaannnndddd _w_i_n_d_o_w ?_v_a_l_u_e? || If _v_a_l_u_e is specified, this command stores _v_a_l_u_e in | _w_i_n_d_o_w's WWWWMMMM____CCCCOOOOMMMMMMMMAAAANNNNDDDD property for use by the window | Page 1 (printed 7/23/95) wwwwmmmm((((nnnn)))) TTTTkkkk (((( )))) wwwwmmmm((((nnnn)))) manager or session manager and returns an empty string. | _V_a_l_u_e must have proper list structure; the elements | should contain the words of the command used to invoke | the application. If _v_a_l_u_e isn't specified then the | command returns the last value set in a wwwwmmmm ccccoooommmmmmmmaaaannnndddd | command for _w_i_n_d_o_w. If _v_a_l_u_e is specified as an empty | string, the command deletes the WWWWMMMM____CCCCOOOOMMMMMMMMAAAANNNNDDDD property | from _w_i_n_d_o_w. wwwwmmmm ddddeeeeiiiiccccoooonnnniiiiffffyyyy _w_i_n_d_o_w Arrange for _w_i_n_d_o_w to be displayed in normal (non- iconified) form. This is done by mapping the window. If the window has never been mapped then this command will not map the window, but it will ensure that when the window is first mapped it will be displayed in de- iconified form. Returns an empty string. wwwwmmmm ffffooooccccuuuussssmmmmooooddddeeeellll _w_i_n_d_o_w ?aaaaccccttttiiiivvvveeee|ppppaaaassssssssiiiivvvveeee? If aaaaccccttttiiiivvvveeee or ppppaaaassssssssiiiivvvveeee is supplied as an optional argument to the command, then it specifies the focus model for _w_i_n_d_o_w. In this case the command returns an empty string. If no additional argument is supplied, then the command returns the current focus model for _w_i_n_d_o_w. An aaaaccccttttiiiivvvveeee focus model means that _w_i_n_d_o_w will claim the input focus for itself or its descendants, even at times when the focus is currently in some other application. PPPPaaaassssssssiiiivvvveeee means that _w_i_n_d_o_w will never claim the focus for itself: the window manager should give the focus to _w_i_n_d_o_w at appropriate times. However, once the focus has been given to _w_i_n_d_o_w or one of its descendants, the application may re-assign the focus among _w_i_n_d_o_w's descendants. The focus model defaults to ppppaaaassssssssiiiivvvveeee, and Tk's ffffooooccccuuuussss command assumes a passive model of focussing. wwwwmmmm ffffrrrraaaammmmeeee _w_i_n_d_o_w If _w_i_n_d_o_w has been reparented by the window manager | into a decorative frame, the command returns the X | window identifier for the outermost frame that contains | _w_i_n_d_o_w (the window whose parent is the root or virtual | root). If _w_i_n_d_o_w hasn't been reparented by the window | manager then the command returns the X window | identifier for _w_i_n_d_o_w. wwwwmmmm ggggeeeeoooommmmeeeettttrrrryyyy _w_i_n_d_o_w ?_n_e_w_G_e_o_m_e_t_r_y? If _n_e_w_G_e_o_m_e_t_r_y is specified, then the geometry of _w_i_n_d_o_w is changed and an empty string is returned. Otherwise the current geometry for _w_i_n_d_o_w is returned (this is the most recent geometry specified either by manual resizing or in a wwwwmmmm ggggeeeeoooommmmeeeettttrrrryyyy command). _N_e_w_G_e_o_m_e_t_r_y has the form ====_w_i_d_t_hxxxx_h_e_i_g_h_t++++_____x++++_____y, where any of ====, _w_i_d_t_hxxxx_h_e_i_g_h_t, or ++++_____x++++_____y may be omitted. _W_i_d_t_h and Page 2 (printed 7/23/95) wwwwmmmm((((nnnn)))) TTTTkkkk (((( )))) wwwwmmmm((((nnnn)))) _h_e_i_g_h_t are positive integers specifying the desired dimensions of _w_i_n_d_o_w. If _w_i_n_d_o_w is gridded (see GRIDDED GEOMETRY MANAGEMENT below) then the dimensions are specified in grid units; otherwise they are specified in pixel units. _X and _y specify the desired location of _w_i_n_d_o_w on the screen, in pixels. If _x is preceded by ++++, it specifies the number of pixels between the left edge of the screen and the left edge of _w_i_n_d_o_w's border; if preceded by ---- then _x specifies the number of pixels between the right edge of the screen and the right edge of _w_i_n_d_o_w's border. If _y is preceded by ++++ then it specifies the number of pixels between the top of the screen and the top of _w_i_n_d_o_w's border; if _y is preceded by ---- then it specifies the number of pixels between the bottom of _w_i_n_d_o_w's border and the bottom of the screen. If _n_e_w_G_e_o_m_e_t_r_y is specified as an empty string then any existing user- specified geometry for _w_i_n_d_o_w is cancelled, and the window will revert to the size requested internally by its widgets. wwwwmmmm ggggrrrriiiidddd _w_i_n_d_o_w ?_b_a_s_e_W_i_d_t_h _b_a_s_e_H_e_i_g_h_t _w_i_d_t_h_I_n_c _h_e_i_g_h_t_I_n_c? This command indicates that _w_i_n_d_o_w is to be managed as a gridded window. It also specifies the relationship between grid units and pixel units. _B_a_s_e_W_i_d_t_h and _b_a_s_e_H_e_i_g_h_t specify the number of grid units corresponding to the pixel dimensions requested internally by _w_i_n_d_o_w using TTTTkkkk____GGGGeeeeoooommmmeeeettttrrrryyyyRRRReeeeqqqquuuueeeesssstttt. _W_i_d_t_h_I_n_c and _h_e_i_g_h_t_I_n_c specify the number of pixels in each horizontal and vertical grid unit. These four values determine a range of acceptable sizes for _w_i_n_d_o_w, corresponding to grid-based widths and heights that are non-negative integers. Tk will pass this information to the window manager; during manual resizing, the window manager will restrict the window's size to one of these acceptable sizes. Furthermore, during manual resizing the window manager will display the window's current size in terms of grid units rather than pixels. If _b_a_s_e_W_i_d_t_h etc. are all specified as empty strings, then _w_i_n_d_o_w will no longer be managed as a gridded window. If _b_a_s_e_W_i_d_t_h etc. are specified then the return value is an empty string. Otherwise the return value is a Tcl list containing four elements corresponding to the current _b_a_s_e_W_i_d_t_h, _b_a_s_e_H_e_i_g_h_t, _w_i_d_t_h_I_n_c, and _h_e_i_g_h_t_I_n_c; if _w_i_n_d_o_w is not currently gridded, then an empty string is returned. Note: this command should not be needed very often, since the TTTTkkkk____SSSSeeeettttGGGGrrrriiiidddd library procedure and the sssseeeettttGGGGrrrriiiidddd option provide easier access to the same functionality. wwwwmmmm ggggrrrroooouuuupppp _w_i_n_d_o_w ?_p_a_t_h_N_a_m_e? If _p_a_t_h_N_a_m_e is specified, it gives the path name for Page 3 (printed 7/23/95) wwwwmmmm((((nnnn)))) TTTTkkkk (((( )))) wwwwmmmm((((nnnn)))) the leader of a group of related windows. The window manager may use this information, for example, to unmap all of the windows in a group when the group's leader is iconified. _P_a_t_h_N_a_m_e may be specified as an empty string to remove _w_i_n_d_o_w from any group association. If _p_a_t_h_N_a_m_e is specified then the command returns an empty string; otherwise it returns the path name of _w_i_n_d_o_w's current group leader, or an empty string if _w_i_n_d_o_w isn't part of any group. wwwwmmmm iiiiccccoooonnnnbbbbiiiittttmmmmaaaapppp _w_i_n_d_o_w ?_b_i_t_m_a_p? If _b_i_t_m_a_p is specified, then it names a bitmap in the standard forms accepted by Tk (see the TTTTkkkk____GGGGeeeettttBBBBiiiittttmmmmaaaapppp manual entry for details). This bitmap is passed to the window manager to be displayed in _w_i_n_d_o_w's icon, and the command returns an empty string. If an empty string is specified for _b_i_t_m_a_p, then any current icon bitmap is cancelled for _w_i_n_d_o_w. If _b_i_t_m_a_p is specified then the command returns an empty string. Otherwise it returns the name of the current icon bitmap associated with _w_i_n_d_o_w, or an empty string if _w_i_n_d_o_w has no icon bitmap. wwwwmmmm iiiiccccoooonnnniiiiffffyyyy _w_i_n_d_o_w Arrange for _w_i_n_d_o_w to be iconified. It _w_i_n_d_o_w hasn't yet been mapped for the first time, this command will arrange for it to appear in the iconified state when it is eventually mapped. wwwwmmmm iiiiccccoooonnnnmmmmaaaasssskkkk _w_i_n_d_o_w ?_b_i_t_m_a_p? If _b_i_t_m_a_p is specified, then it names a bitmap in the standard forms accepted by Tk (see the TTTTkkkk____GGGGeeeettttBBBBiiiittttmmmmaaaapppp manual entry for details). This bitmap is passed to the window manager to be used as a mask in conjunction with the iiiiccccoooonnnnbbbbiiiittttmmmmaaaapppp option: where the mask has zeroes no icon will be displayed; where it has ones, the bits from the icon bitmap will be displayed. If an empty string is specified for _b_i_t_m_a_p then any current icon mask is cancelled for _w_i_n_d_o_w (this is equivalent to specifying a bitmap of all ones). If _b_i_t_m_a_p is specified then the command returns an empty string. Otherwise it returns the name of the current icon mask associated with _w_i_n_d_o_w, or an empty string if no mask is in effect. wwwwmmmm iiiiccccoooonnnnnnnnaaaammmmeeee _w_i_n_d_o_w ?_n_e_w_N_a_m_e? If _n_e_w_N_a_m_e is specified, then it is passed to the window manager; the window manager should display _n_e_w_N_a_m_e inside the icon associated with _w_i_n_d_o_w. In this case an empty string is returned as result. If _n_e_w_N_a_m_e isn't specified then the command returns the current icon name for _w_i_n_d_o_w, or an empty string if no Page 4 (printed 7/23/95) wwwwmmmm((((nnnn)))) TTTTkkkk (((( )))) wwwwmmmm((((nnnn)))) icon name has been specified (in this case the window manager will normally display the window's title, as specified with the wwwwmmmm ttttiiiittttlllleeee command). wwwwmmmm iiiiccccoooonnnnppppoooossssiiiittttiiiioooonnnn _w_i_n_d_o_w ?_x _y? If _x and _y are specified, they are passed to the window manager as a hint about where to position the icon for _w_i_n_d_o_w. In this case an empty string is returned. If _x and _y are specified as empty strings then any existing icon position hint is cancelled. If neither _x nor _y is specified, then the command returns a Tcl list containing two values, which are the current icon position hints (if no hints are in effect then an empty string is returned). wwwwmmmm iiiiccccoooonnnnwwwwiiiinnnnddddoooowwww _w_i_n_d_o_w ?_p_a_t_h_N_a_m_e? If _p_a_t_h_N_a_m_e is specified, it is the path name for a window to use as icon for _w_i_n_d_o_w: when _w_i_n_d_o_w is iconified then _p_a_t_h_N_a_m_e should be mapped to serve as icon, and when _w_i_n_d_o_w is de-iconified then _p_a_t_h_N_a_m_e will be unmapped again. If _p_a_t_h_N_a_m_e is specified as an empty string then any existing icon window association for _w_i_n_d_o_w will be cancelled. If the _p_a_t_h_N_a_m_e argument is specified then an empty string is returned. Otherwise the command returns the path name of the current icon window for _w_i_n_d_o_w, or an empty string if there is no icon window currently specified for _w_i_n_d_o_w. Note: not all window managers support the notion of an icon window. wwwwmmmm mmmmaaaaxxxxssssiiiizzzzeeee _w_i_n_d_o_w ?_w_i_d_t_h _h_e_i_g_h_t? If _w_i_d_t_h and _h_e_i_g_h_t are specified, then _w_i_n_d_o_w becomes resizable and _w_i_d_t_h and _h_e_i_g_h_t give its maximum permissible dimensions. For gridded windows the dimensions are specified in grid units; otherwise they are specified in pixel units. During manual sizing, the window manager should restrict the window's dimensions to be less than or equal to _w_i_d_t_h and _h_e_i_g_h_t. If _w_i_d_t_h and _h_e_i_g_h_t are specified as empty strings, then the maximum size option is cancelled for _w_i_n_d_o_w. If _w_i_d_t_h and _h_e_i_g_h_t are specified, then the command returns an empty string. Otherwise it returns a Tcl list with two elements, which are the maximum width and height currently in effect; if no maximum dimensions are in effect for _w_i_n_d_o_w then an empty string is returned. See the sections on geometry management below for more information. wwwwmmmm mmmmiiiinnnnssssiiiizzzzeeee _w_i_n_d_o_w ?_w_i_d_t_h _h_e_i_g_h_t? If _w_i_d_t_h and _h_e_i_g_h_t are specified, then _w_i_n_d_o_w becomes resizable and _w_i_d_t_h and _h_e_i_g_h_t give its minimum permissible dimensions. For gridded windows the Page 5 (printed 7/23/95) wwwwmmmm((((nnnn)))) TTTTkkkk (((( )))) wwwwmmmm((((nnnn)))) dimensions are specified in grid units; otherwise they are specified in pixel units. During manual sizing, the window manager should restrict the window's dimensions to be greater than or equal to _w_i_d_t_h and _h_e_i_g_h_t. If _w_i_d_t_h and _h_e_i_g_h_t are specified as empty strings, then the minimum size option is cancelled for _w_i_n_d_o_w. If _w_i_d_t_h and _h_e_i_g_h_t are specified, then the command returns an empty string. Otherwise it returns a Tcl list with two elements, which are the minimum width and height currently in effect; if no minimum dimensions are in effect for _w_i_n_d_o_w then an empty string is returned. See the sections on geometry management below for more information. wwwwmmmm oooovvvveeeerrrrrrrriiiiddddeeeerrrreeeeddddiiiirrrreeeecccctttt _w_i_n_d_o_w ?_b_o_o_l_e_a_n? If _b_o_o_l_e_a_n is specified, it must have a proper boolean | form and the override-redirect flag for _w_i_n_d_o_w is set | to that value. If _b_o_o_l_e_a_n is not specified then 1111 or 0000 | is returned to indicate whether or not the override- | redirect flag is currently set for _w_i_n_d_o_w. Setting the | override-redirect flag for a window causes it to be | ignored by the window manager; among other things, | this means that the window will not be reparented from | the root window into a decorative frame and the user | will not be able to manipulate the window using the | normal window manager mechanisms. wwwwmmmm ppppoooossssiiiittttiiiioooonnnnffffrrrroooommmm _w_i_n_d_o_w ?_w_h_o? If _w_h_o is specified, it must be either pppprrrrooooggggrrrraaaammmm or uuuusssseeeerrrr, or an abbreviation of one of these two. It indicates whether _w_i_n_d_o_w's current position was requested by the program or by the user. Many window managers ignore program-requested initial positions and ask the user to manually position the window; if uuuusssseeeerrrr is specified then the window manager should position the window at the given place without asking the user for assistance. If _w_h_o is specified as an empty string, then the current position source is cancelled. If _w_h_o is specified, then the command returns an empty string. Otherwise it returns uuuusssseeeerrrr or wwwwiiiinnnnddddoooowwww to indicate the source of the window's current position, or an empty string if no source has been specified yet. Most window managers interpret ``no source'' as equivalent to pppprrrrooooggggrrrraaaammmm. Tk will automatically set the position | source to uuuusssseeeerrrr when a wwwwmmmm ggggeeeeoooommmmeeeettttrrrryyyy command is invoked, | unless the source has been set explicitly to pppprrrrooooggggrrrraaaammmm. | wwwwmmmm pppprrrroooottttooooccccoooollll _w_i_n_d_o_w ?_n_a_m_e? ?_c_o_m_m_a_n_d? || This command is used to manage window manager protocols | such as WWWWMMMM____DDDDEEEELLLLEEEETTTTEEEE____WWWWIIIINNNNDDDDOOOOWWWW. _N_a_m_e is the name of an atom | corresponding to a window manager protocol, such as | WWWWMMMM____DDDDEEEELLLLEEEETTTTEEEE____WWWWIIIINNNNDDDDOOOOWWWW or WWWWMMMM____SSSSAAAAVVVVEEEE____YYYYOOOOUUUURRRRSSSSEEEELLLLFFFF or WWWWMMMM____TTTTAAAAKKKKEEEE____FFFFOOOOCCCCUUUUSSSS. | Page 6 (printed 7/23/95) wwwwmmmm((((nnnn)))) TTTTkkkk (((( )))) wwwwmmmm((((nnnn)))) If both _n_a_m_e and _c_o_m_m_a_n_d are specified, then _c_o_m_m_a_n_d is | associated with the protocol specified by _n_a_m_e. _N_a_m_e | will be added to _w_i_n_d_o_w's WWWWMMMM____PPPPRRRROOOOTTTTOOOOCCCCOOOOLLLLSSSS property to tell | the window manager that the application has a protocol | handler for _n_a_m_e, and _c_o_m_m_a_n_d will be invoked in the | future whenever the window manager sends a message to | the client for that protocol. In this case the command | returns an empty string. If _n_a_m_e is specified but | _c_o_m_m_a_n_d isn't, then the current command for _n_a_m_e is | returned, or an empty string if there is no handler | defined for _n_a_m_e. If _c_o_m_m_a_n_d is specified as an empty | string then the current handler for _n_a_m_e is deleted and | it is removed from the WWWWMMMM____PPPPRRRROOOOTTTTOOOOCCCCOOOOLLLLSSSS property on _w_i_n_d_o_w; | an empty string is returned. Lastly, if neither _n_a_m_e | nor _c_o_m_m_a_n_d is specified, the command returns a list of | all the protocols for which handlers are currently | defined for _w_i_n_d_o_w. | Tk always defines a protocol handler for | WWWWMMMM____DDDDEEEELLLLEEEETTTTEEEE____WWWWIIIINNNNDDDDOOOOWWWW, even if you haven't asked for one | with wwwwmmmm pppprrrroooottttooooccccoooollll. If a WWWWMMMM____DDDDEEEELLLLEEEETTTTEEEE____WWWWIIIINNNNDDDDOOOOWWWW message | arrives when you haven't defined a handler, then Tk | handles the message by destroying the window for which | it was received. | wwwwmmmm ssssiiiizzzzeeeeffffrrrroooommmm _w_i_n_d_o_w ?_w_h_o? If _w_h_o is specified, it must be either pppprrrrooooggggrrrraaaammmm or uuuusssseeeerrrr, or an abbreviation of one of these two. It indicates whether _w_i_n_d_o_w's current size was requested by the program or by the user. Some window managers ignore program-requested sizes and ask the user to manually size the window; if uuuusssseeeerrrr is specified then the window manager should give the window its specified size without asking the user for assistance. If _w_h_o is specified as an empty string, then the current size source is cancelled. If _w_h_o is specified, then the command returns an empty string. Otherwise it returns uuuusssseeeerrrr or wwwwiiiinnnnddddoooowwww to indicate the source of the window's current size, or an empty string if no source has been specified yet. Most window managers interpret ``no source'' as equivalent to pppprrrrooooggggrrrraaaammmm. wwwwmmmm ssssttttaaaatttteeee _w_i_n_d_o_w Returns the current state of _w_i_n_d_o_w: either nnnnoooorrrrmmmmaaaallll, | iiiiccccoooonnnniiiicccc, or wwwwiiiitttthhhhddddrrrraaaawwwwnnnn. wwwwmmmm ttttiiiittttlllleeee _w_i_n_d_o_w ?_s_t_r_i_n_g? If _s_t_r_i_n_g is specified, then it will be passed to the window manager for use as the title for _w_i_n_d_o_w (the window manager should display this string in _w_i_n_d_o_w's title bar). In this case the command returns an empty string. If _s_t_r_i_n_g isn't specified then the command Page 7 (printed 7/23/95) wwwwmmmm((((nnnn)))) TTTTkkkk (((( )))) wwwwmmmm((((nnnn)))) returns the current title for the _w_i_n_d_o_w. The title for a window defaults to its name. wwwwmmmm ttttrrrraaaannnnssssiiiieeeennnntttt _w_i_n_d_o_w ?_m_a_s_t_e_r? If _m_a_s_t_e_r is specified, then the window manager is informed that _w_i_n_d_o_w is a transient window (e.g. pull- down menu) working on behalf of _m_a_s_t_e_r (where _m_a_s_t_e_r is the path name for a top-level window). Some window managers will use this information to manage _w_i_n_d_o_w specially. If _m_a_s_t_e_r is specified as an empty string then _w_i_n_d_o_w is marked as not being a transient window any more. If _m_a_s_t_e_r is specified, then the command returns an empty string. Otherwise the command returns the path name of _w_i_n_d_o_w's current master, or an empty string if _w_i_n_d_o_w isn't currently a transient window. wwwwmmmm wwwwiiiitttthhhhddddrrrraaaawwww _w_i_n_d_o_w Arranges for _w_i_n_d_o_w to be withdrawn from the screen. This causes the window to be unmapped and forgotten about by the window manager. If the window has never | been mapped, then this command causes the window to be | mapped in the withdrawn state. Not all window managers | appear to know how to handle windows that are mapped in | the withdrawn state. Note: it sometimes seems to be necessary to withdraw a window and then re-map it (e.g. with wwwwmmmm ddddeeeeiiiiccccoooonnnniiiiffffyyyy) to get some window managers to pay attention to changes in window attributes such as group. SSSSOOOOUUUURRRRCCCCEEEESSSS OOOOFFFF GGGGEEEEOOOOMMMMEEEETTTTRRRRYYYY IIIINNNNFFFFOOOORRRRMMMMAAAATTTTIIIIOOOONNNN Size-related information for top-level windows can come from three sources. First, geometry requests come from the widgets that are descendants of a top-level window. Each widget requests a particular size for itself by calling TTTTkkkk____GGGGeeeeoooommmmeeeettttrrrryyyyRRRReeeeqqqquuuueeeesssstttt. This information is passed to geometry managers, which then request large enough sizes for parent windows so that they can layout the children properly. Geometry information passes upwards through the window hierarchy until eventually a particular size is requested for each top-level window. These requests are called _i_n_t_e_r_n_a_l _r_e_q_u_e_s_t_s in the discussion below. The second source of width and height information is through the wwwwmmmm ggggeeeeoooommmmeeeettttrrrryyyy command. Third, the user can request a particular size for a window using the interactive facilities of the window manager. The second and third types of geometry requests are called _e_x_t_e_r_n_a_l _r_e_q_u_e_s_t_s in the discussion below; Tk treats these two kinds of requests identically. UUUUNNNNGGGGRRRRIIIIDDDDDDDDEEEEDDDD GGGGEEEEOOOOMMMMEEEETTTTRRRRYYYY MMMMAAAANNNNAAAAGGGGEEEEMMMMEEEENNNNTTTT Tk allows the geometry of a top-level window to be managed Page 8 (printed 7/23/95) wwwwmmmm((((nnnn)))) TTTTkkkk (((( )))) wwwwmmmm((((nnnn)))) in either of two general ways: ungridded or gridded. The ungridded form occurs if no wwwwmmmm ggggrrrriiiidddd command has been issued for a top-level window. Ungridded management has several variants. In the simplest variant of ungridded windows, no wwwwmmmm ggggeeeeoooommmmeeeettttrrrryyyy, wwwwmmmm mmmmiiiinnnnssssiiiizzzzeeee, or wwwwmmmm mmmmaaaaxxxxssssiiiizzzzeeee commands have been invoked either. In this case, the window's size is determined totally by the internal requests emanating from the widgets inside the window: Tk will ask the window manager not to permit the user to resize the window interactively. If a wwwwmmmm ggggeeeeoooommmmeeeettttrrrryyyy command is invoked on an ungridded window, then the size in that command overrides any size requested by the window's widgets; from now on, the window's size will be determined entirely by the most recent information from wwwwmmmm ggggeeeeoooommmmeeeettttrrrryyyy commands. To go back to using the size requested by the window's widgets, issue a wwwwmmmm ggggeeeeoooommmmeeeettttrrrryyyy command with an empty _g_e_o_m_e_t_r_y string. To enable interactive resizing of an ungridded window, one or both of the wwwwmmmm mmmmaaaaxxxxssssiiiizzzzeeee and wwwwmmmm mmmmiiiinnnnssssiiiizzzzeeee commands must be issued. The information from these commands will be passed to the window manager, and size changes within the specified range will be permitted. For ungridded windows the limits refer to the top-level window's dimensions in pixels. If only a wwwwmmmm mmmmaaaaxxxxssssiiiizzzzeeee command is issued then the minimum dimensions default to 1; if only a wwwwmmmm mmmmiiiinnnnssssiiiizzzzeeee command is | issued then the maximum dimensions default to the size of | the display. If the size of a window is changed interactively, it has the same effect as if wwwwmmmm ggggeeeeoooommmmeeeettttrrrryyyy had been invoked: from now on, internal geometry requests will be ignored. To return to internal control over the window's size, issue a wwwwmmmm ggggeeeeoooommmmeeeettttrrrryyyy command with an empty _g_e_o_m_e_t_r_y argument. If a window has been manually resized or moved, the wwwwmmmm ggggeeeeoooommmmeeeettttrrrryyyy command will return the geometry that was requested interactively. GGGGRRRRIIIIDDDDDDDDEEEEDDDD GGGGEEEEOOOOMMMMEEEETTTTRRRRYYYY MMMMAAAANNNNAAAAGGGGEEEEMMMMEEEENNNNTTTT The second style of geometry management is called _g_r_i_d_d_e_d. This approach occurs when one of the widgets of an application supports a range of useful sizes. This occurs, for example, in a text editor where the scrollbars, menus, and other adornments are fixed in size but the edit widget can support any number of lines of text or characters per line. In this case, it is usually desirable to let the user specify the number of lines or characters-per-line, either with the wwwwmmmm ggggeeeeoooommmmeeeettttrrrryyyy command or by interactively resizing the window. In the case of text, and in other interesting cases also, only discrete sizes of the window make sense, such as integral numbers of lines and characters-per-line; arbitrary pixel sizes are not useful. Page 9 (printed 7/23/95) wwwwmmmm((((nnnn)))) TTTTkkkk (((( )))) wwwwmmmm((((nnnn)))) Gridded geometry management provides support for this kind of application. Tk (and the window manager) assume that there is a grid of some sort within the application and that the application should be resized in terms of _g_r_i_d _u_n_i_t_s rather than pixels. Gridded geometry management is typically invoked by turning on the sssseeeettttGGGGrrrriiiidddd option for a widget; it can also be invoked with the wwwwmmmm ggggrrrriiiidddd command or by calling TTTTkkkk____SSSSeeeettttGGGGrrrriiiidddd. In each of these approaches the particular widget (or sometimes code in the application as a whole) specifies the relationship between integral grid sizes for the window and pixel sizes. To return to non- gridded geometry management, invoke wwwwmmmm ggggrrrriiiidddd with empty argument strings. When gridded geometry management is enabled then all the dimensions specified in wwwwmmmm mmmmiiiinnnnssssiiiizzzzeeee, wwwwmmmm mmmmaaaaxxxxssssiiiizzzzeeee, and wwwwmmmm ggggeeeeoooommmmeeeettttrrrryyyy commands are treated as grid units rather than pixel units. Interactive resizing is automatically enabled, and it will be carried out in even numbers of grid units rather than pixels. By default there are no limits on the minimum or maximum dimensions of a gridded window. As with ungridded windows, interactive resizing has exactly the same effect as invoking the wwwwmmmm ggggeeeeoooommmmeeeettttrrrryyyy command. For gridded windows, internally- and externally-requested dimensions work together: the externally-specified width and height determine the size of the window in grid units, and the information from the last wwwwmmmm ggggrrrriiiidddd command maps from grid units to pixel units. BBBBUUUUGGGGSSSS The window manager interactions seem too complicated, especially for managing geometry. Suggestions on how to simplify this would be greatly appreciated. Most existing window managers appear to have bugs that affect the operation of the wwwwmmmm command. For example, some changes won't take effect if the window is already active: the window will have to be withdrawn and de-iconified in order to make the change happen. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS aspect ratio, deiconify, focus model, geometry, grid, group, icon, iconify, increments, position, size, title, top-level window, units, window manager Page 10 (printed 7/23/95)