PageRenderTime 44ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/help/02TclTk8.4/UserCmd/wish.htm

https://github.com/nenopera/ramdebugger
HTML | 206 lines | 201 code | 5 blank | 0 comment | 0 complexity | 407ceaedfac8969a36305dc636efe8b1 MD5 | raw file
Possible License(s): AGPL-3.0
  1. <HTML><HEAD><TITLE>Tk Applications - wish manual page</TITLE></HEAD><BODY>
  2. <DL>
  3. <DD><A HREF="wish.htm#M2" NAME="L15">NAME</A>
  4. <DL><DD>wish - Simple windowing shell</DL>
  5. <DD><A HREF="wish.htm#M3" NAME="L16">SYNOPSIS</A>
  6. <DL>
  7. <DD><B>wish</B> ?<I>fileName arg arg ...</I>?
  8. </DL>
  9. <DD><A HREF="wish.htm#M4" NAME="L17">OPTIONS</A>
  10. <DL>
  11. <DD><A HREF="wish.htm#M5" NAME="L18"><B>-colormap </B><I>new</I></A>
  12. <DD><A HREF="wish.htm#M6" NAME="L19"><B>-display </B><I>display</I></A>
  13. <DD><A HREF="wish.htm#M7" NAME="L20"><B>-geometry </B><I>geometry</I></A>
  14. <DD><A HREF="wish.htm#M8" NAME="L21"><B>-name </B><I>name</I></A>
  15. <DD><A HREF="wish.htm#M9" NAME="L22"><B>-sync</B></A>
  16. <DD><A HREF="wish.htm#M10" NAME="L23"><B>-use</B> <I>id</I></A>
  17. <DD><A HREF="wish.htm#M11" NAME="L24"><B>-visual </B><I>visual</I></A>
  18. <DD><A HREF="wish.htm#M12" NAME="L25"><B>-&nbsp;-</B></A>
  19. </DL>
  20. <DD><A HREF="wish.htm#M13" NAME="L26">DESCRIPTION</A>
  21. <DD><A HREF="wish.htm#M14" NAME="L27">OPTIONS</A>
  22. <DD><A HREF="wish.htm#M15" NAME="L28">APPLICATION NAME AND CLASS</A>
  23. <DD><A HREF="wish.htm#M16" NAME="L29">VARIABLES</A>
  24. <DL>
  25. <DD><A HREF="wish.htm#M17" NAME="L30"><B>argc</B></A>
  26. <DD><A HREF="wish.htm#M18" NAME="L31"><B>argv</B></A>
  27. <DD><A HREF="wish.htm#M19" NAME="L32"><B>argv0</B></A>
  28. <DD><A HREF="wish.htm#M20" NAME="L33"><B>geometry</B></A>
  29. <DD><A HREF="wish.htm#M21" NAME="L34"><B>tcl_interactive</B></A>
  30. </DL>
  31. <DD><A HREF="wish.htm#M22" NAME="L35">SCRIPT FILES</A>
  32. <DD><A HREF="wish.htm#M23" NAME="L36">PROMPTS</A>
  33. <DD><A HREF="wish.htm#M24" NAME="L37">KEYWORDS</A>
  34. </DL><HR>
  35. <H3><A NAME="M2">NAME</A></H3>
  36. wish - Simple windowing shell
  37. <H3><A NAME="M3">SYNOPSIS</A></H3>
  38. <B>wish</B> ?<I>fileName arg arg ...</I>?<BR>
  39. <H3><A NAME="M4">OPTIONS</A></H3>
  40. <DL>
  41. <P><DT><A NAME="M5"><B>-colormap </B><I>new</I></A><DD>
  42. Specifies that the window should have a new private colormap instead of
  43. using the default colormap for the screen.
  44. <P><DT><A NAME="M6"><B>-display </B><I>display</I></A><DD>
  45. Display (and screen) on which to display window.
  46. <P><DT><A NAME="M7"><B>-geometry </B><I>geometry</I></A><DD>
  47. Initial geometry to use for window. If this option is specified, its
  48. value is stored in the <B>geometry</B> global variable of the application's
  49. Tcl interpreter.
  50. <P><DT><A NAME="M8"><B>-name </B><I>name</I></A><DD>
  51. Use <I>name</I> as the title to be displayed in the window, and
  52. as the name of the interpreter for <B><A HREF="../TkCmd/send.htm">send</A></B> commands.
  53. <P><DT><A NAME="M9"><B>-sync</B></A><DD>
  54. Execute all X server commands synchronously, so that errors
  55. are reported immediately. This will result in much slower
  56. execution, but it is useful for debugging.
  57. <P><DT><A NAME="M10"><B>-use</B> <I>id</I></A><DD>
  58. Specifies that the main window for the application is to be embedded in
  59. the window whose identifier is <I>id</I>, instead of being created as an
  60. independent toplevel window. <I>Id</I> must be specified in the same
  61. way as the value for the <B>-use</B> option for toplevel widgets (i.e.
  62. it has a form like that returned by the <B><A HREF="../TkCmd/winfo.htm">winfo id</A></B> command).
  63. <P><DT><A NAME="M11"><B>-visual </B><I>visual</I></A><DD>
  64. Specifies the visual to use for the window.
  65. <I>Visual</I> may have any of the forms supported by the <B><A HREF="../TkLib/GetVisual.htm">Tk_GetVisual</A></B>
  66. procedure.
  67. <P><DT><A NAME="M12"><B>-&nbsp;-</B></A><DD>
  68. Pass all remaining arguments through to the script's <B>argv</B>
  69. variable without interpreting them.
  70. This provides a mechanism for passing arguments such as <B>-name</B>
  71. to a script instead of having <B>wish</B> interpret them.
  72. <P></DL>
  73. <H3><A NAME="M13">DESCRIPTION</A></H3>
  74. <B>Wish</B> is a simple program consisting of the Tcl command
  75. language, the Tk toolkit, and a main program that reads commands
  76. from standard input or from a file.
  77. It creates a main window and then processes Tcl commands.
  78. If <B>wish</B> is invoked with no arguments, or with a first argument
  79. that starts with ``-'', then it reads Tcl commands interactively from
  80. standard input.
  81. It will continue processing commands until all windows have been
  82. deleted or until end-of-file is reached on standard input.
  83. If there exists a file <B>.wishrc</B> in the home directory of
  84. the user, <B>wish</B> evaluates the file as a Tcl script
  85. just before reading the first command from standard input.
  86. <P>
  87. If <B>wish</B> is invoked with an initial <I>fileName</I> argument, then
  88. <I>fileName</I> is treated as the name of a script file.
  89. <B>Wish</B> will evaluate the script in <I>fileName</I> (which
  90. presumably creates a user interface), then it will respond to events
  91. until all windows have been deleted.
  92. Commands will not be read from standard input.
  93. There is no automatic evaluation of <B>.wishrc</B> when the name
  94. of a script file is presented on the <B>wish</B> command line,
  95. but the script file can always <B><A HREF="../TclCmd/source.htm">source</A></B> it if desired.
  96. <H3><A NAME="M14">OPTIONS</A></H3>
  97. <B>Wish</B> automatically processes all of the command-line options
  98. described in the <B><A HREF="../TkCmd/options.htm">OPTIONS</A></B> summary above.
  99. Any other command-line arguments besides these are passed through
  100. to the application using the <B>argc</B> and <B>argv</B> variables
  101. described later.
  102. <H3><A NAME="M15">APPLICATION NAME AND CLASS</A></H3>
  103. The name of the application, which is used for purposes such as
  104. <B><A HREF="../TkCmd/send.htm">send</A></B> commands, is taken from the <B>-name</B> option,
  105. if it is specified; otherwise it is taken from <I>fileName</I>,
  106. if it is specified, or from the command name by which
  107. <B>wish</B> was invoked. In the last two cases, if the name contains a ``/''
  108. character, then only the characters after the last slash are used
  109. as the application name.
  110. <P>
  111. The class of the application, which is used for purposes such as
  112. specifying options with a <B>RESOURCE_MANAGER</B> property or .Xdefaults
  113. file, is the same as its name except that the first letter is
  114. capitalized.
  115. <H3><A NAME="M16">VARIABLES</A></H3>
  116. <B>Wish</B> sets the following Tcl variables:
  117. <P>
  118. <DL>
  119. <P><DT><A NAME="M17"><B>argc</B></A><DD>
  120. Contains a count of the number of <I>arg</I> arguments (0 if none),
  121. not including the options described above.
  122. <P><DT><A NAME="M18"><B>argv</B></A><DD>
  123. Contains a Tcl list whose elements are the <I>arg</I> arguments
  124. that follow a <B>-&nbsp;-</B> option or don't match any of the
  125. options described in OPTIONS above, in order, or an empty string
  126. if there are no such arguments.
  127. <P><DT><A NAME="M19"><B>argv0</B></A><DD>
  128. Contains <I>fileName</I> if it was specified.
  129. Otherwise, contains the name by which <B>wish</B> was invoked.
  130. <P><DT><A NAME="M20"><B>geometry</B></A><DD>
  131. If the <B>-geometry</B> option is specified, <B>wish</B> copies its
  132. value into this variable. If the variable still exists after
  133. <I>fileName</I> has been evaluated, <B>wish</B> uses the value of
  134. the variable in a <B><A HREF="../TkCmd/wm.htm">wm geometry</A></B> command to set the main
  135. window's geometry.
  136. <P><DT><A NAME="M21"><B>tcl_interactive</B></A><DD>
  137. Contains 1 if <B>wish</B> is reading commands interactively (<I>fileName</I>
  138. was not specified and standard input is a terminal-like
  139. device), 0 otherwise.
  140. <P></DL>
  141. <H3><A NAME="M22">SCRIPT FILES</A></H3>
  142. If you create a Tcl script in a file whose first line is
  143. <PRE><B>#!/usr/local/bin/wish</B></PRE>
  144. then you can invoke the script file directly from your shell if
  145. you mark it as executable.
  146. This assumes that <B>wish</B> has been installed in the default
  147. location in /usr/local/bin; if it's installed somewhere else
  148. then you'll have to modify the above line to match.
  149. Many UNIX systems do not allow the <B>#!</B> line to exceed about
  150. 30 characters in length, so be sure that the <B>wish</B> executable
  151. can be accessed with a short file name.
  152. <P>
  153. An even better approach is to start your script files with the
  154. following three lines:
  155. <PRE><B>#!/bin/sh
  156. # the next line restarts using wish &#92;
  157. exec wish &quot;$0&quot; &quot;$@&quot;</B></PRE>
  158. This approach has three advantages over the approach in the previous
  159. paragraph. First, the location of the <B>wish</B> binary doesn't have
  160. to be hard-wired into the script: it can be anywhere in your shell
  161. search path. Second, it gets around the 30-character file name limit
  162. in the previous approach.
  163. Third, this approach will work even if <B>wish</B> is
  164. itself a shell script (this is done on some systems in order to
  165. handle multiple architectures or operating systems: the <B>wish</B>
  166. script selects one of several binaries to run). The three lines
  167. cause both <B>sh</B> and <B>wish</B> to process the script, but the
  168. <B><A HREF="../TclCmd/exec.htm">exec</A></B> is only executed by <B>sh</B>.
  169. <B>sh</B> processes the script first; it treats the second
  170. line as a comment and executes the third line.
  171. The <B><A HREF="../TclCmd/exec.htm">exec</A></B> statement cause the shell to stop processing and
  172. instead to start up <B>wish</B> to reprocess the entire script.
  173. When <B>wish</B> starts up, it treats all three lines as comments,
  174. since the backslash at the end of the second line causes the third
  175. line to be treated as part of the comment on the second line.
  176. <P>
  177. The end of a script file may be marked either by the physical end of
  178. the medium, or by the character, '&#92;032' ('&#92;u001a', control-Z).
  179. If this character is present in the file, the <B>wish</B> application
  180. will read text up to but not including the character. An application
  181. that requires this character in the file may encode it as
  182. ``&#92;032'', ``&#92;x1a'', or ``&#92;u001a''; or may generate it by use of commands
  183. such as <B><A HREF="../TclCmd/format.htm">format</A></B> or <B><A HREF="../TclCmd/binary.htm">binary</A></B>.
  184. <H3><A NAME="M23">PROMPTS</A></H3>
  185. When <B>wish</B> is invoked interactively it normally prompts for each
  186. command with ``<B>% </B>''. You can change the prompt by setting the
  187. variables <B>tcl_prompt1</B> and <B>tcl_prompt2</B>. If variable
  188. <B>tcl_prompt1</B> exists then it must consist of a Tcl script
  189. to output a prompt; instead of outputting a prompt <B>wish</B>
  190. will evaluate the script in <B>tcl_prompt1</B>.
  191. The variable <B>tcl_prompt2</B> is used in a similar way when
  192. a newline is typed but the current command isn't yet complete;
  193. if <B>tcl_prompt2</B> isn't set then no prompt is output for
  194. incomplete commands.
  195. <H3><A NAME="M24">KEYWORDS</A></H3>
  196. <A href="../Keywords/S.htm#shell">shell</A>, <A href="../Keywords/T.htm#toolkit">toolkit</A>
  197. <HR><PRE>
  198. <A HREF="../copyright.htm">Copyright</A> &#169; 1991-1994 The Regents of the University of California.
  199. <A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
  200. <A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
  201. </BODY></HTML>