home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd1.bin / zkuste / Perl / ActivePerl-5.6.0.613.msi / 䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥 / _0fbaab675b6167fd0740abd0a6279a02 < prev    next >
Text File  |  2000-03-23  |  35KB  |  620 lines

  1.  
  2. <HTML>
  3. <HEAD>
  4. <TITLE>Tk::Wm - Communicate with window manager</TITLE>
  5. <LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
  6. <LINK REV="made" HREF="mailto:">
  7. </HEAD>
  8.  
  9. <BODY>
  10. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  11. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  12. <STRONG><P CLASS=block> Tk::Wm - Communicate with window manager</P></STRONG>
  13. </TD></TR>
  14. </TABLE>
  15.  
  16. <A NAME="__index__"></A>
  17. <!-- INDEX BEGIN -->
  18.  
  19. <UL>
  20.  
  21.     <LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
  22.  
  23.     <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
  24.     <LI><A HREF="#description">DESCRIPTION</A></LI>
  25.     <LI><A HREF="#icon sizes">ICON SIZES</A></LI>
  26.     <LI><A HREF="#geometry management">GEOMETRY MANAGEMENT</A></LI>
  27.     <LI><A HREF="#gridded geometry management">GRIDDED GEOMETRY MANAGEMENT</A></LI>
  28.     <LI><A HREF="#bugs">BUGS</A></LI>
  29.     <LI><A HREF="#see also">SEE ALSO</A></LI>
  30.     <LI><A HREF="#keywords">KEYWORDS</A></LI>
  31. </UL>
  32. <!-- INDEX END -->
  33.  
  34. <HR>
  35. <P>
  36. <H1><A NAME="name">NAME</A></H1>
  37. <P>Tk::Wm - Communicate with window manager</P>
  38. <P>
  39. <HR>
  40. <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
  41. <UL>
  42. <LI>Linux</LI>
  43. <LI>Solaris</LI>
  44. <LI>Windows</LI>
  45. </UL>
  46. <HR>
  47. <H1><A NAME="synopsis">SYNOPSIS</A></H1>
  48. <P>    <EM>$toplevel</EM>-><EM>method</EM>(?<EM>args</EM>?)</P>
  49. <P>
  50. <HR>
  51. <H1><A NAME="description">DESCRIPTION</A></H1>
  52. <P>The <STRONG>wm</STRONG> methods are used to interact with window managers in
  53. order to control such things as the title for a window, its geometry,
  54. or the increments in terms of which it may be resized.
  55. The <STRONG>wm</STRONG> methods can take any of a number of different forms, depending on
  56. the particular <EM>method</EM> argument.
  57. All of the forms expect <EM>$toplevel</EM>, which must be a
  58. top-level window object.</P>
  59. <P>The legal forms for the <STRONG>wm</STRONG> methods are:</P>
  60. <DL>
  61. <DT><STRONG><A NAME="item_aspect"><EM>$toplevel</EM>-><STRONG>aspect</STRONG>(?<EM>minNumer minDenom maxNumer maxDenom</EM>?)</A></STRONG><BR>
  62. <DD>
  63. If <EM>minNumer</EM>, <EM>minDenom</EM>, <EM>maxNumer</EM>, and <EM>maxDenom</EM>
  64. are all specified, then they will be passed to the window manager
  65. and the window manager should use them to enforce a range of
  66. acceptable aspect ratios for <EM>$toplevel</EM>.  The aspect ratio of
  67. <EM>$toplevel</EM> (width/length) will be constrained to lie
  68. between <EM>minNumer</EM>/<EM>minDenom</EM> and <EM>maxNumer</EM>/<EM>maxDenom</EM>.
  69. If <EM>minNumer</EM> etc. are all specified as empty strings, then
  70. any existing aspect ratio restrictions are removed.
  71. If <EM>minNumer</EM> etc. are specified, then the method returns an
  72. empty string.  Otherwise, it returns
  73. a array containing four elements, which are the current values
  74. of <EM>minNumer</EM>, <EM>minDenom</EM>, <EM>maxNumer</EM>, and <EM>maxDenom</EM>
  75. (if no aspect restrictions are in effect, then an empty string is
  76. returned).
  77. <P></P>
  78. <DT><STRONG><A NAME="item_client"><EM>$toplevel</EM>-><STRONG>client</STRONG>(?<EM>name</EM>?)</A></STRONG><BR>
  79. <DD>
  80. If <EM>name</EM> is specified, this method stores <EM>name</EM> (which
  81. should be the name of
  82. the host on which the application is executing) in <EM>$toplevel</EM>'s
  83. <STRONG>WM_CLIENT_MACHINE</STRONG> property for use by the window manager or
  84. session manager.
  85. The method returns an empty string in this case.
  86. If <EM>name</EM> isn't specified, the method returns the last name
  87. set in a <STRONG>client</STRONG> method for <EM>$toplevel</EM>.
  88. If <EM>name</EM> is specified as an empty string, the method deletes the
  89. <STRONG>WM_CLIENT_MACHINE</STRONG> property from <EM>$toplevel</EM>.
  90. <P></P>
  91. <DT><STRONG><A NAME="item_colormapwindows"><EM>$toplevel</EM>-><STRONG>colormapwindows</STRONG>(?<EM>windowList</EM>?)</A></STRONG><BR>
  92. <DD>
  93. This method is used to manipulate the <STRONG>WM_COLORMAP_WINDOWS</STRONG>
  94. property, which provides information to the window managers about
  95. windows that have private colormaps.
  96. If <EM>windowList</EM> isn't specified, the method returns a list
  97. whose elements are the names of the windows in the <STRONG>WM_COLORMAP_WINDOWS</STRONG>
  98. property.
  99. If <EM>windowList</EM> is specified, it consists of a list of widgets;
  100. the method overwrites the <STRONG>WM_COLORMAP_WINDOWS</STRONG>
  101. property with the given windows and returns an empty string.
  102. The <STRONG>WM_COLORMAP_WINDOWS</STRONG> property should normally contain a
  103. list of the internal windows within <EM>$toplevel</EM> whose colormaps differ
  104. from their parents.
  105. The order of the windows in the property indicates a priority order:
  106. the window manager will attempt to install as many colormaps as possible
  107. from the head of this list when <EM>$widget</EM> gets the colormap focus.
  108. If <EM>$widget</EM> is not included among the windows in <EM>windowList</EM>,
  109. Tk implicitly adds it at the end of the <STRONG>WM_COLORMAP_WINDOWS</STRONG>
  110. property, so that its colormap is lowest in priority.
  111. If <EM>$widget</EM>->colormapwindows is not invoked, Tk will automatically set
  112. the property for each top-level window to all the internal windows
  113. whose colormaps differ from their parents, followed by the top-level
  114. itself;  the order of the internal windows is undefined.
  115. See the ICCCM documentation for more information on the
  116. <STRONG>WM_COLORMAP_WINDOWS</STRONG> property.
  117. <P></P>
  118. <DT><STRONG><A NAME="item_command"><EM>$toplevel</EM>-><STRONG>command</STRONG>(?<EM>value</EM>?)</A></STRONG><BR>
  119. <DD>
  120. If <EM>value</EM> is specified, this method stores <EM>value</EM> in <EM>$toplevel</EM>'s
  121. <STRONG>WM_COMMAND</STRONG> property for use by the window manager or
  122. session manager and returns an empty string.
  123. <EM>Value</EM> must have proper list structure;  the elements should
  124. contain the words of the command used to invoke the application.
  125. If <EM>value</EM> isn't specified then the method returns the last value
  126. set in a <STRONG>command</STRONG> method for <EM>$toplevel</EM>.
  127. If <EM>value</EM> is specified as an empty string, the method
  128. deletes the <STRONG>WM_COMMAND</STRONG> property from <EM>$toplevel</EM>.
  129. <P></P>
  130. <DT><STRONG><A NAME="item_deiconify"><EM>$toplevel</EM>-><STRONG>deiconify</STRONG></A></STRONG><BR>
  131. <DD>
  132. Arrange for <EM>$toplevel</EM> to be displayed in normal (non-iconified) form.
  133. This is done by mapping the window.  If the window has never been
  134. mapped then this method will not map the window, but it will ensure
  135. that when the window is first mapped it will be displayed
  136. in de-iconified form.  Returns an empty string.
  137. <P></P>
  138. <DT><STRONG><A NAME="item_focusmodel"><EM>$toplevel</EM>-><STRONG>focusmodel</STRONG>(?<STRONG>active</STRONG>|<STRONG>passive</STRONG>?)</A></STRONG><BR>
  139. <DD>
  140. If <STRONG>active</STRONG> or <STRONG>passive</STRONG> is supplied as an optional argument
  141. to the method, then it specifies the focus model for <EM>$toplevel</EM>.
  142. In this case the method returns an empty string.  If no additional
  143. argument is supplied, then the method returns the current focus
  144. model for <EM>$toplevel</EM>.
  145. An <STRONG>active</STRONG> focus model means that <EM>$toplevel</EM> will claim the
  146. input focus for itself or its descendants, even at times when
  147. the focus is currently in some other application.  <STRONG>Passive</STRONG> means that
  148. <EM>$toplevel</EM> will never claim the focus for itself:  the window manager
  149. should give the focus to <EM>$toplevel</EM> at appropriate times.  However,
  150. once the focus has been given to <EM>$toplevel</EM> or one of its descendants,
  151. the application may re-assign the focus among <EM>$toplevel</EM>'s descendants.
  152. The focus model defaults to <STRONG>passive</STRONG>, and Tk's <STRONG>focus</STRONG> method
  153. assumes a passive model of focusing.
  154. <P></P>
  155. <DT><STRONG><A NAME="item_frame"><EM>$toplevel</EM>-><STRONG>frame</STRONG></A></STRONG><BR>
  156. <DD>
  157. If <EM>$widget</EM> has been reparented by the window manager into a
  158. decorative frame, the method returns the platform specific window
  159. identifier for the outermost frame that contains <EM>$toplevel</EM> (the
  160. window whose parent is the root or virtual root).  If <EM>$toplevel</EM>
  161. hasn't been reparented by the window manager then the method returns
  162. the platform specific window identifier for <EM>$toplevel</EM>.
  163. <P></P>
  164. <DT><STRONG><A NAME="item_geometry"><EM>$toplevel</EM>-><STRONG>geometry</STRONG>(?<EM>newGeometry</EM>?)</A></STRONG><BR>
  165. <DD>
  166. If <EM>newGeometry</EM> is specified, then the geometry of <EM>$toplevel</EM>
  167. is changed and an empty string is returned.  Otherwise the current
  168. geometry for <EM>$toplevel</EM> is returned (this is the most recent
  169. geometry specified either by manual resizing or
  170. in a <STRONG>geometry</STRONG> method).  <EM>NewGeometry</EM> has
  171. the form <STRONG>=</STRONG><EM>width</EM><STRONG>x</STRONG><EM>height</EM><STRONG>+-</STRONG><EM>x</EM><STRONG>+-</STRONG><EM>y</EM>, where
  172. any of <STRONG>=</STRONG>, <EM>width</EM><STRONG>x</STRONG><EM>height</EM>, or <STRONG>+-</STRONG><EM>x</EM><STRONG>+-</STRONG><EM>y</EM>
  173. may be omitted.  <EM>Width</EM> and <EM>height</EM> are positive integers
  174. specifying the desired dimensions of <EM>$toplevel</EM>.  If <EM>$toplevel</EM>
  175. is gridded (see <A HREF="#gridded geometry management">GRIDDED GEOMETRY MANAGEMENT</A> below) then the dimensions
  176. are specified in grid units;  otherwise they are specified in pixel
  177. units.  <EM>X</EM> and <EM>y</EM> specify the desired location of
  178. <EM>$toplevel</EM> on the screen, in pixels.
  179. If <EM>x</EM> is preceded by <STRONG>+</STRONG>, it specifies
  180. the number of pixels between the left edge of the screen and the left
  181. edge of <EM>$toplevel</EM>'s border;  if preceded by <STRONG>-</STRONG> then
  182. <EM>x</EM> specifies the number of pixels
  183. between the right edge of the screen and the right edge of <EM>$toplevel</EM>'s
  184. border.  If <EM>y</EM> is preceded by <STRONG>+</STRONG> then it specifies the
  185. number of pixels between the top of the screen and the top
  186. of <EM>$toplevel</EM>'s border;  if <EM>y</EM> is preceded by <STRONG>-</STRONG> then
  187. it specifies the number of pixels between the bottom of <EM>$toplevel</EM>'s
  188. border and the bottom of the screen.
  189. If <EM>newGeometry</EM> is specified as an empty string then any
  190. existing user-specified geometry for <EM>$toplevel</EM> is cancelled, and
  191. the window will revert to the size requested internally by its
  192. widgets.
  193. <P></P>
  194. <DT><STRONG><A NAME="item_wmGrid"><EM>$toplevel</EM>-><STRONG>wmGrid</STRONG>(?<EM>baseWidth,baseHeight,widthInc,heightInc</EM>?)</A></STRONG><BR>
  195. <DD>
  196. This method indicates that <EM>$toplevel</EM> is to be managed as a
  197. gridded window.
  198. It also specifies the relationship between grid units and pixel units.
  199. <EM>BaseWidth</EM> and <EM>baseHeight</EM> specify the number of grid
  200. units corresponding to the pixel dimensions requested internally
  201. by <EM>$toplevel</EM> using <STRONG>Tk_GeometryRequest</STRONG>.  <EM>WidthInc</EM>
  202. and <EM>heightInc</EM> specify the number of pixels in each horizontal
  203. and vertical grid unit.
  204. These four values determine a range of acceptable sizes for
  205. <EM>$toplevel</EM>, corresponding to grid-based widths and heights
  206. that are non-negative integers.
  207. Tk will pass this information to the window manager;  during
  208. manual resizing, the window manager will restrict the window's size
  209. to one of these acceptable sizes.
  210. Furthermore, during manual resizing the window manager will display
  211. the window's current size in terms of grid units rather than pixels.
  212. If <EM>baseWidth</EM> etc. are all specified as empty strings, then
  213. <EM>$toplevel</EM> will no longer be managed as a gridded window.  If
  214. <EM>baseWidth</EM> etc. are specified then the return value is an
  215. empty string.
  216. Otherwise the return value is a array containing
  217. four elements corresponding to the current <EM>baseWidth</EM>,
  218. <EM>baseHeight</EM>, <EM>widthInc</EM>, and <EM>heightInc</EM>;  if
  219. <EM>$toplevel</EM> is not currently gridded, then an empty string
  220. is returned.
  221. Note: this command should not be needed very often, since the
  222. <STRONG>Tk_SetGrid</STRONG> library procedure and the <STRONG>-setgrid</STRONG> option
  223. provide easier access to the same functionality.
  224. <P></P>
  225. <DT><STRONG><A NAME="item_group"><EM>$toplevel</EM>-><STRONG>group</STRONG>(?<EM>$widget</EM>?)</A></STRONG><BR>
  226. <DD>
  227. If <EM>$widget</EM> is specified, it is the the leader of
  228. a group of related windows.  The window manager may use this information,
  229. for example, to unmap all of the windows in a group when the group's
  230. leader is iconified.  <EM>$widget</EM> may be specified as an empty string to
  231. remove <EM>$toplevel</EM> from any group association.  If <EM>$widget</EM> is
  232. specified then the method returns an empty string;  otherwise it
  233. returns the <EM>$toplevel</EM>'s current group leader, or an empty
  234. string if <EM>$toplevel</EM> isn't part of any group.
  235. <P></P>
  236. <DT><STRONG><A NAME="item_iconbitmap"><EM>$toplevel</EM>-><STRONG>iconbitmap</STRONG>(?<EM>bitmap</EM>?)</A></STRONG><BR>
  237. <DD>
  238. If <EM>bitmap</EM> is specified, then it names a bitmap in the standard
  239. forms accepted by Tk (see the <STRONG>Tk_GetBitmap</STRONG> documentation for details).
  240. This <EM>black and white</EM> bitmap is passed to the window manager to be displayed
  241. in <EM>$toplevel</EM>'s icon, and the method returns an empty string.  If
  242. an empty string is specified for <EM>bitmap</EM>, then any current icon
  243. bitmap or image is cancelled for <EM>$toplevel</EM>.
  244. If <EM>bitmap</EM> is specified then the method returns an empty string.
  245. Otherwise it returns the name of
  246. the current icon bitmap associated with <EM>$toplevel</EM>, or an empty
  247. string if <EM>$toplevel</EM> has no icon bitmap.
  248. <P></P>
  249. <DT><STRONG><A NAME="item_iconify"><EM>$toplevel</EM>-><STRONG>iconify</STRONG></A></STRONG><BR>
  250. <DD>
  251. Arrange for <EM>$toplevel</EM> to be iconified.  It <EM>$toplevel</EM> hasn't
  252. yet been mapped for the first time, this method will arrange for
  253. it to appear in the iconified state when it is eventually mapped.
  254. <P></P>
  255. <DT><STRONG><A NAME="item_iconimage"><EM>$toplevel</EM>-><STRONG>iconimage</STRONG>(?<EM>image</EM>?)</A></STRONG><BR>
  256. <DD>
  257. If <EM>image</EM> is specified, then it names a normal Tk image.
  258. This image is rendered into a private <EM>coloured</EM> bitmap which is passed to
  259. the window manager to be displayed in <EM>$toplevel</EM>'s icon, and the method returns
  260. an empty string. If an empty string is specified for <EM>image</EM>, then any current
  261. icon bitmap or image is cancelled for <EM>$toplevel</EM>.
  262. If <EM>image</EM> is specified then the method returns an empty string.
  263. Otherwise it returns the name of
  264. the current icon image associated with <EM>$toplevel</EM>, or an empty
  265. string if <EM>$toplevel</EM> has no icon image.
  266. The private pixmap is not pre-cleared so images which are partly ``transparent''
  267. display rubbish in their transparent parts.
  268. <P>The sizes of images that can be used as icons in this manner are platform
  269. dependant. On Win32 this sets the ``large'' icon, which should be 32x32, it
  270. will automatically be scaled down to 16x16 for use as a small icon.</P>
  271. <P></P>
  272. <DT><STRONG><A NAME="item_iconmask"><EM>$toplevel</EM>-><STRONG>iconmask</STRONG>(?<EM>bitmap</EM>?)</A></STRONG><BR>
  273. <DD>
  274. If <EM>bitmap</EM> is specified, then it names a bitmap in the standard
  275. forms accepted by Tk (see the <STRONG>Tk_GetBitmap</STRONG> documentation for details).
  276. This bitmap is passed to the window manager to be used as a mask
  277. in conjunction with the <STRONG>iconbitmap</STRONG> option:  where the mask
  278. has zeroes no icon will be displayed;  where it has ones, the bits
  279. from the icon bitmap will be displayed.  If
  280. an empty string is specified for <EM>bitmap</EM> then any current icon
  281. mask is cancelled for <EM>$toplevel</EM> (this is equivalent to specifying
  282. a bitmap of all ones).  If <EM>bitmap</EM> is specified
  283. then the method returns an empty string.  Otherwise it
  284. returns the name of the current icon mask associated with
  285. <EM>$toplevel</EM>, or an empty string if no mask is in effect.
  286. <P></P>
  287. <DT><STRONG><A NAME="item_iconname"><EM>$toplevel</EM>-><STRONG>iconname</STRONG>(?<EM>newName</EM>?)</A></STRONG><BR>
  288. <DD>
  289. If <EM>newName</EM> is specified, then it is passed to the window
  290. manager;  the window manager should display <EM>newName</EM> inside
  291. the icon associated with <EM>$toplevel</EM>.  In this case an empty
  292. string is returned as result.  If <EM>newName</EM> isn't specified
  293. then the method returns the current icon name for <EM>$toplevel</EM>,
  294. or an empty string if no icon name has been specified (in this
  295. case the window manager will normally display the window's title,
  296. as specified with the <STRONG>title</STRONG> method).
  297. <P></P>
  298. <DT><STRONG><A NAME="item_iconposition"><EM>$toplevel</EM>-><STRONG>iconposition</STRONG>(?<EM>x y</EM>?)</A></STRONG><BR>
  299. <DD>
  300. If <EM>x</EM> and <EM>y</EM> are specified, they are passed to the window
  301. manager as a hint about where to position the icon for <EM>$toplevel</EM>.
  302. In this case an empty string is returned.  If <EM>x</EM> and <EM>y</EM> are
  303. specified as empty strings then any existing icon position hint is cancelled.
  304. If neither <EM>x</EM> nor <EM>y</EM> is specified, then the method returns
  305. a array containing two values, which are the current icon position
  306. hints (if no hints are in effect then an empty string is returned).
  307. <P></P>
  308. <DT><STRONG><A NAME="item_iconwindow"><EM>$toplevel</EM>-><STRONG>iconwindow</STRONG>(?<EM>$widget</EM>?)</A></STRONG><BR>
  309. <DD>
  310. If <EM>$widget</EM> is specified, it is a window to
  311. use as icon for <EM>$toplevel</EM>: when <EM>$toplevel</EM> is iconified then
  312. <EM>$widget</EM> will be mapped to serve as icon, and when <EM>$toplevel</EM>
  313. is de-iconified then <EM>$widget</EM> will be unmapped again.  If
  314. <EM>$widget</EM> is specified as an empty string then any existing
  315. icon window association for <EM>$toplevel</EM> will be cancelled.  If
  316. the <EM>$widget</EM> argument is specified then an empty string is
  317. returned.  Otherwise the method returns the
  318. current icon window for <EM>$toplevel</EM>, or an empty string if there
  319. is no icon window currently specified for <EM>$toplevel</EM>.
  320. Button press events are disabled for <EM>$toplevel</EM> as long as it is
  321. an icon window;  this is needed in order to allow window managers
  322. to ``own'' those events.
  323. Note: not all window managers support the notion of an icon window.
  324. <P></P>
  325. <DT><STRONG><A NAME="item_maxsize"><EM>$toplevel</EM>-><STRONG>maxsize</STRONG>(?<EM>width,height</EM>?)</A></STRONG><BR>
  326. <DD>
  327. If <EM>width</EM> and <EM>height</EM> are specified, they give
  328. the maximum permissible dimensions for <EM>$toplevel</EM>.
  329. For gridded windows the dimensions are specified in
  330. grid units;  otherwise they are specified in pixel units.
  331. The window manager will restrict the window's dimensions to be
  332. less than or equal to <EM>width</EM> and <EM>height</EM>.
  333. If <EM>width</EM> and <EM>height</EM> are
  334. specified, then the method returns an empty string.  Otherwise
  335. it returns a array with two elements, which are the
  336. maximum width and height currently in effect.
  337. The maximum size defaults to the size of the screen.
  338. If resizing has been disabled with the <STRONG>resizable</STRONG> method,
  339. then this method has no effect.
  340. See the sections on geometry management below for more information.
  341. <P></P>
  342. <DT><STRONG><A NAME="item_minsize"><EM>$toplevel</EM>-><STRONG>minsize</STRONG>(?<EM>width,height</EM>?)</A></STRONG><BR>
  343. <DD>
  344. If <EM>width</EM> and <EM>height</EM> are specified, they give the
  345. minimum permissible dimensions for <EM>$toplevel</EM>.
  346. For gridded windows the dimensions are specified in
  347. grid units;  otherwise they are specified in pixel units.
  348. The window manager will restrict the window's dimensions to be
  349. greater than or equal to <EM>width</EM> and <EM>height</EM>.
  350. If <EM>width</EM> and <EM>height</EM> are
  351. specified, then the method returns an empty string.  Otherwise
  352. it returns a array with two elements, which are the
  353. minimum width and height currently in effect.
  354. The minimum size defaults to one pixel in each dimension.
  355. If resizing has been disabled with the <STRONG>resizable</STRONG> method,
  356. then this method has no effect.
  357. See the sections on geometry management below for more information.
  358. <P></P>
  359. <DT><STRONG><A NAME="item_overrideredirect"><EM>$toplevel</EM>-><STRONG>overrideredirect(?</STRONG><EM>boolean</EM>?)</A></STRONG><BR>
  360. <DD>
  361. If <EM>boolean</EM> is specified, it must have a proper boolean form and
  362. the override-redirect flag for <EM>$toplevel</EM> is set to that value.
  363. If <EM>boolean</EM> is not specified then <STRONG>1</STRONG> or <STRONG>0</STRONG> is
  364. returned to indicate whether or not the override-redirect flag
  365. is currently set for <EM>$toplevel</EM>.
  366. Setting the override-redirect flag for a window causes
  367. it to be ignored by the window manager;  among other things, this means
  368. that the window will not be reparented from the root window into a
  369. decorative frame and the user will not be able to manipulate the
  370. window using the normal window manager mechanisms.
  371. <P></P>
  372. <DT><STRONG><A NAME="item_positionfrom"><EM>$toplevel</EM>-><STRONG>positionfrom</STRONG>(?<EM>who</EM>?)</A></STRONG><BR>
  373. <DD>
  374. If <EM>who</EM> is specified, it must be either <STRONG>program</STRONG> or
  375. <STRONG>user</STRONG>, or an abbreviation of one of these two.  It indicates
  376. whether <EM>$toplevel</EM>'s current position was requested by the
  377. program or by the user.  Many window managers ignore program-requested
  378. initial positions and ask the user to manually position the window;  if
  379. <STRONG>user</STRONG> is specified then the window manager should position the
  380. window at the given place without asking the user for assistance.
  381. If <EM>who</EM> is specified as an empty string, then the current position
  382. source is cancelled.
  383. If <EM>who</EM> is specified, then the method returns an empty string.
  384. Otherwise it returns <STRONG>user</STRONG> or $widget to indicate the
  385. source of the window's current position, or an empty string if
  386. no source has been specified yet.  Most window managers interpret
  387. ``no source'' as equivalent to <STRONG>program</STRONG>.
  388. Tk will automatically set the position source to <STRONG>user</STRONG>
  389. when a <STRONG>geometry</STRONG> method is invoked, unless the source has
  390. been set explicitly to <STRONG>program</STRONG>.
  391. <P></P>
  392. <DT><STRONG><A NAME="item_protocol"><EM>$toplevel</EM>-><STRONG>protocol</STRONG>(?<EM>name</EM>?,?<EM>callback</EM>?)</A></STRONG><BR>
  393. <DD>
  394. This method is used to manage window manager protocols such as
  395. <STRONG>WM_DELETE_WINDOW</STRONG>.
  396. <EM>Name</EM> is the name of an atom corresponding to a window manager
  397. protocol, such as <STRONG>WM_DELETE_WINDOW</STRONG> or <STRONG>WM_SAVE_YOURSELF</STRONG>
  398. or <STRONG>WM_TAKE_FOCUS</STRONG>.
  399. If both <EM>name</EM> and <EM>callback</EM> are specified, then <EM>callback</EM>
  400. is associated with the protocol specified by <EM>name</EM>.
  401. <EM>Name</EM> will be added to <EM>$toplevel</EM>'s <STRONG>WM_PROTOCOLS</STRONG>
  402. property to tell the window manager that the application has a
  403. protocol handler for <EM>name</EM>, and <EM>callback</EM> will
  404. be invoked in the future whenever the window manager sends a
  405. message to the client for that protocol.
  406. In this case the method returns an empty string.
  407. If <EM>name</EM> is specified but <EM>callback</EM> isn't, then the current
  408. callback for <EM>name</EM> is returned, or an empty string if there
  409. is no handler defined for <EM>name</EM>.
  410. If <EM>callback</EM> is specified as an empty string then the current
  411. handler for <EM>name</EM> is deleted and it is removed from the
  412. <STRONG>WM_PROTOCOLS</STRONG> property on <EM>$toplevel</EM>;  an empty string is
  413. returned.
  414. Lastly, if neither <EM>name</EM> nor <EM>callback</EM> is specified, the
  415. method returns a list of all the protocols for which handlers
  416. are currently defined for <EM>$toplevel</EM>.
  417. <P>Tk always defines a protocol handler for <STRONG>WM_DELETE_WINDOW</STRONG>, even if
  418. you haven't asked for one with <STRONG>protocol</STRONG>.
  419. If a <STRONG>WM_DELETE_WINDOW</STRONG> message arrives when you haven't defined
  420. a handler, then Tk handles the message by destroying the window for
  421. which it was received.</P>
  422. <DT><STRONG><A NAME="item_resizable"><EM>$toplevel</EM>-><STRONG>resizable</STRONG>(?<EM>width,height</EM>?)</A></STRONG><BR>
  423. <DD>
  424. This method controls whether or not the user may interactively
  425. resize a top-level window.  If <EM>width</EM> and <EM>height</EM> are
  426. specified, they are boolean values that determine whether the
  427. width and height of <EM>$toplevel</EM> may be modified by the user.
  428. In this case the method returns an empty string.
  429. If <EM>width</EM> and <EM>height</EM> are omitted then the method
  430. returns a list with two 0/1 elements that indicate whether the
  431. width and height of <EM>$toplevel</EM> are currently resizable.
  432. By default, windows are resizable in both dimensions.
  433. If resizing is disabled, then the window's size will be the size
  434. from the most recent interactive resize or <STRONG>geometry</STRONG>
  435. method.  If there has been no such operation then
  436. the window's natural size will be used.
  437. <P></P>
  438. <DT><STRONG><A NAME="item_sizefrom"><EM>$toplevel</EM>-><STRONG>sizefrom</STRONG>(?<EM>who</EM>?)</A></STRONG><BR>
  439. <DD>
  440. If <EM>who</EM> is specified, it must be either <STRONG>program</STRONG> or
  441. <STRONG>user</STRONG>, or an abbreviation of one of these two.  It indicates
  442. whether <EM>$toplevel</EM>'s current size was requested by the
  443. program or by the user.  Some window managers ignore program-requested
  444. sizes and ask the user to manually size the window;  if
  445. <STRONG>user</STRONG> is specified then the window manager should give the
  446. window its specified size without asking the user for assistance.
  447. If <EM>who</EM> is specified as an empty string, then the current size
  448. source is cancelled.
  449. If <EM>who</EM> is specified, then the method returns an empty string.
  450. Otherwise it returns <STRONG>user</STRONG> or $widget to indicate the
  451. source of the window's current size, or an empty string if
  452. no source has been specified yet.  Most window managers interpret
  453. ``no source'' as equivalent to <STRONG>program</STRONG>.
  454. <P></P>
  455. <DT><STRONG><A NAME="item_state"><EM>$toplevel</EM>-><STRONG>state</STRONG></A></STRONG><BR>
  456. <DD>
  457. Returns the current state of $widget:  either <STRONG>normal</STRONG>,
  458. <STRONG>iconic</STRONG>, <STRONG>withdrawn</STRONG>, or <STRONG>icon</STRONG>.  The difference
  459. between <STRONG>iconic</STRONG> and <STRONG>icon</STRONG> is that <STRONG>iconic</STRONG> refers
  460. to a window that has been iconified (e.g., with the <STRONG>iconify</STRONG>
  461. method) while <STRONG>icon</STRONG> refers to a window whose only purpose is
  462. to serve as the icon for some other window (via the <STRONG>iconwindow</STRONG>
  463. method).
  464. <P></P>
  465. <DT><STRONG><A NAME="item_title"><EM>$toplevel</EM>-><STRONG>title</STRONG>(?<EM>string</EM>?)</A></STRONG><BR>
  466. <DD>
  467. If <EM>string</EM> is specified, then it will be passed to the window
  468. manager for use as the title for <EM>$toplevel</EM> (the window manager
  469. should display this string in <EM>$toplevel</EM>'s title bar).  In this
  470. case the method returns an empty string.  If <EM>string</EM> isn't
  471. specified then the method returns the current title for the
  472. <EM>$toplevel</EM>.  The title for a window defaults to its name.
  473. <P></P>
  474. <DT><STRONG><A NAME="item_transient"><EM>$toplevel</EM>-><STRONG>transient</STRONG>(?<EM>master</EM>?)</A></STRONG><BR>
  475. <DD>
  476. If <EM>master</EM> is specified, then the window manager is informed
  477. that <EM>$toplevel</EM> is a transient window (e.g. pull-down menu) working
  478. on behalf of <EM>master</EM> (where <EM>master</EM> is
  479. a top-level window).  Some window managers will use
  480. this information to manage <EM>$toplevel</EM> specially.  If <EM>master</EM>
  481. is specified as an empty string then <EM>$toplevel</EM> is marked as not
  482. being a transient window any more.  If <EM>master</EM> is specified,
  483. then the method returns an empty string.  Otherwise the method
  484. returns the path name of <EM>$toplevel</EM>'s current master, or an
  485. empty string if <EM>$toplevel</EM> isn't currently a transient window.
  486. <P></P>
  487. <DT><STRONG><A NAME="item_withdraw"><EM>$toplevel</EM>-><STRONG>withdraw</STRONG></A></STRONG><BR>
  488. <DD>
  489. Arranges for <EM>$toplevel</EM> to be withdrawn from the screen.  This
  490. causes the window to be unmapped and forgotten about by the window
  491. manager.  If the window
  492. has never been mapped, then this method
  493. causes the window to be mapped in the withdrawn state.  Not all
  494. window managers appear to know how to handle windows that are
  495. mapped in the withdrawn state.
  496. Note: it sometimes seems to be necessary to withdraw a
  497. window and then re-map it (e.g. with <STRONG>deiconify</STRONG>) to get some
  498. window managers to pay attention to changes in window attributes
  499. such as group.
  500. <P></P>
  501. <DT><STRONG><A NAME="item_wrapper"><EM>$toplevel</EM>-><STRONG>wrapper</STRONG></A></STRONG><BR>
  502. <DD>
  503. Returns the window id of the wrapper window in which Tk has placed
  504. <EM>$toplevel</EM>. This is the id by which window manager will know
  505. <EM>$toplevel</EM>, and so is appropriate place to add X properties.
  506. <P></P></DL>
  507. <P>
  508. <HR>
  509. <H1><A NAME="icon sizes">ICON SIZES</A></H1>
  510. <P>The sizes of bitmaps/images that can be used as icons in this manner are platform
  511. and window manager dependant. Unix window managers are typically more tolerant
  512. than Win32. It is possible that coloured <A HREF="#item_iconimage"><CODE>iconimage</CODE></A> icons may cause problems
  513. on some X window managers.</P>
  514. <UL>
  515. <LI><STRONG><A NAME="item_Win32">Win32</A></STRONG><BR>
  516.  
  517. <A HREF="#item_iconimage"><CODE>iconimage</CODE></A> and <A HREF="#item_iconbitmap"><CODE>iconbitmap</CODE></A> set the ``large'' icon, which should be
  518. 32x32, it will automatically be scaled down to 16x16 for use as a small icon.
  519. Win32 ignores <CODE>iconwin</CODE> requests.
  520. <P></P>
  521. <LI><STRONG><A NAME="item_KDE%27s_%22kwm%22">KDE's ``kwm''</A></STRONG><BR>
  522.  
  523. <PRE>
  524.  
  525. Accepts coloured C<iconimage> and black and white C<iconbitmap> but 
  526. will scale either to a small (14x14?) icon. Kwm ignores C<iconwin>.</PRE>
  527. <LI><STRONG><A NAME="item_Sun%27s_%22olwm%22_or_%22olvwm%22">Sun's ``olwm'' or ``olvwm''</A></STRONG><BR>
  528.  
  529. Honours <CODE>iconwin</CODE> which will override <A HREF="#item_iconimage"><CODE>iconimage</CODE></A> or <A HREF="#item_iconbitmap"><CODE>iconbitmap</CODE></A>.
  530. Coloured images work.
  531. <P></P>
  532. <LI><STRONG><A NAME="item_Sun%27s_CDE_window_manager">Sun's CDE window manager</A></STRONG><BR>
  533.  
  534. Coloured images work. ...
  535. <P></P></UL>
  536. <P>
  537. <HR>
  538. <H1><A NAME="geometry management">GEOMETRY MANAGEMENT</A></H1>
  539. <P>By default a top-level window appears on the screen in its
  540. <EM>natural size</EM>, which is the one determined internally by its
  541. widgets and geometry managers.
  542. If the natural size of a top-level window changes, then the window's size
  543. changes to match.
  544. A top-level window can be given a size other than its natural size in two ways.
  545. First, the user can resize the window manually using the facilities
  546. of the window manager, such as resize handles.
  547. Second, the application can request a particular size for a
  548. top-level window using the <STRONG>geometry</STRONG> method.
  549. These two cases are handled identically by Tk;  in either case,
  550. the requested size overrides the natural size.
  551. You can return the window to its natural by invoking <STRONG>geometry</STRONG>
  552. with an empty <EM>geometry</EM> string.</P>
  553. <P>Normally a top-level window can have any size from one pixel in each
  554. dimension up to the size of its screen.
  555. However, you can use the <STRONG>minsize</STRONG> and <STRONG>maxsize</STRONG> methods
  556. to limit the range of allowable sizes.
  557. The range set by <STRONG>minsize</STRONG> and <STRONG>maxsize</STRONG> applies to
  558. all forms of resizing, including the window's natural size as
  559. well as manual resizes and the <STRONG>geometry</STRONG> method.
  560. You can also use the method <STRONG>resizable</STRONG> to completely
  561. disable interactive resizing in one or both dimensions.</P>
  562. <P>
  563. <HR>
  564. <H1><A NAME="gridded geometry management">GRIDDED GEOMETRY MANAGEMENT</A></H1>
  565. <P>Gridded geometry management occurs when one of the widgets of an
  566. application supports a range of useful sizes.
  567. This occurs, for example, in a text editor where the scrollbars,
  568. menus, and other adornments are fixed in size but the edit widget
  569. can support any number of lines of text or characters per line.
  570. In this case, it is usually desirable to let the user specify the
  571. number of lines or characters-per-line, either with the
  572. <STRONG>geometry</STRONG> method or by interactively resizing the window.
  573. In the case of text, and in other interesting cases also, only
  574. discrete sizes of the window make sense, such as integral numbers
  575. of lines and characters-per-line;  arbitrary pixel sizes are not useful.</P>
  576. <P>Gridded geometry management provides support for this kind of
  577. application.
  578. Tk (and the window manager) assume that there is a grid of some
  579. sort within the application and that the application should be
  580. resized in terms of <EM>grid units</EM> rather than pixels.
  581. Gridded geometry management is typically invoked by turning on
  582. the <STRONG>setGrid</STRONG> option for a widget;  it can also be invoked
  583. with the <STRONG>wmGrid</STRONG> method or by calling <STRONG>Tk_SetGrid</STRONG>.
  584. In each of these approaches the particular widget (or sometimes
  585. code in the application as a whole) specifies the relationship between
  586. integral grid sizes for the window and pixel sizes.
  587. To return to non-gridded geometry management, invoke
  588. <STRONG>grid</STRONG> with empty argument strings.</P>
  589. <P>When gridded geometry management is enabled then all the dimensions specified
  590. in <STRONG>minsize</STRONG>, <STRONG>maxsize</STRONG>, and <STRONG>geometry</STRONG> methods
  591. are treated as grid units rather than pixel units.
  592. Interactive resizing is also carried out in even numbers of grid units
  593. rather than pixels.</P>
  594. <P>
  595. <HR>
  596. <H1><A NAME="bugs">BUGS</A></H1>
  597. <P>Most existing window managers appear to have bugs that affect the
  598. operation of the <STRONG>wm</STRONG> methods.  For example, some changes won't
  599. take effect if the window is already active:  the window will have
  600. to be withdrawn and de-iconified in order to make the change happen.</P>
  601. <P>
  602. <HR>
  603. <H1><A NAME="see also">SEE ALSO</A></H1>
  604. <P><A HREF="../../../site/lib/Tk/Widget.html">Tk::Widget</A>
  605. <A HREF="../../../site/lib/Tk/tixWm.html">Tk::tixWm</A>
  606. <A HREF="../../../site/lib/Tk/Mwm.html">Tk::Mwm</A></P>
  607. <P>
  608. <HR>
  609. <H1><A NAME="keywords">KEYWORDS</A></H1>
  610. <P>aspect ratio, deiconify, focus model, geometry, grid, group, icon, iconify, increments, position, size, title, top-level window, units, window manager</P>
  611. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  612. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  613. <STRONG><P CLASS=block> Tk::Wm - Communicate with window manager</P></STRONG>
  614. </TD></TR>
  615. </TABLE>
  616.  
  617. </BODY>
  618.  
  619. </HTML>
  620.