annotate Doc/libmacconsole.tex @ 6719:faebc1940432 legacy-trunk

Understand -Xlinker option.
author Guido van Rossum <guido@python.org>
date Tue, 02 Dec 1997 20:38:11 +0000
parents 3468ea8645ca
children bf4e790bd61a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2576
f47bc5554418 mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents: 2527
diff changeset
1 \section{Built-in Module \sectcode{macconsole}}
5818
3468ea8645ca AMK's megapatch:
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
2 \label{module-macconsole}
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3 \bimodindex{macconsole}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2452
diff changeset
5 \renewcommand{\indexsubitem}{(in module macconsole)}
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2452
diff changeset
6
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
7 This module is available on the Macintosh, provided Python has been
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
8 built using the Think C compiler. It provides an interface to the
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
9 Think console package, with which basic text windows can be created.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
10
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
11 \begin{datadesc}{options}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
12 An object allowing you to set various options when creating windows,
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
13 see below.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
14 \end{datadesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
15
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
16 \begin{datadesc}{C_ECHO}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
17 \dataline{C_NOECHO}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
18 \dataline{C_CBREAK}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
19 \dataline{C_RAW}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
20 Options for the \code{setmode} method. \var{C_ECHO} and \var{C_CBREAK}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
21 enable character echo, the other two disable it, \var{C_ECHO} and
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
22 \var{C_NOECHO} enable line-oriented input (erase/kill processing,
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
23 etc).
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
24 \end{datadesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
25
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
26 \begin{funcdesc}{copen}{}
2527
815dfaa6a778 small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents: 2453
diff changeset
27 Open a new console window. Return a console window object.
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
28 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
29
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
30 \begin{funcdesc}{fopen}{fp}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
31 Return the console window object corresponding with the given file
2527
815dfaa6a778 small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents: 2453
diff changeset
32 object. \var{fp} should be one of \code{sys.stdin}, \code{sys.stdout} or
815dfaa6a778 small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents: 2453
diff changeset
33 \code{sys.stderr}.
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
34 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
35
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
36 \subsection{macconsole options object}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
37 These options are examined when a window is created:
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
38
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
39 \renewcommand{\indexsubitem}{(macconsole option)}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
40 \begin{datadesc}{top}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
41 \dataline{left}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
42 The origin of the window.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
43 \end{datadesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
44
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
45 \begin{datadesc}{nrows}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
46 \dataline{ncols}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
47 The size of the window.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
48 \end{datadesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
49
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
50 \begin{datadesc}{txFont}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
51 \dataline{txSize}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
52 \dataline{txStyle}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
53 The font, fontsize and fontstyle to be used in the window.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
54 \end{datadesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
55
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
56 \begin{datadesc}{title}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
57 The title of the window.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
58 \end{datadesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
59
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
60 \begin{datadesc}{pause_atexit}
2527
815dfaa6a778 small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents: 2453
diff changeset
61 If set non-zero, the window will wait for user action before closing.
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
62 \end{datadesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
63
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
64 \subsection{console window object}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
65
2576
f47bc5554418 mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents: 2527
diff changeset
66 \renewcommand{\indexsubitem}{(console window attribute)}
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
67
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
68 \begin{datadesc}{file}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
69 The file object corresponding to this console window. If the file is
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
70 buffered, you should call \code{file.flush()} between \code{write()}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
71 and \code{read()} calls.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
72 \end{datadesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
73
2576
f47bc5554418 mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents: 2527
diff changeset
74 \renewcommand{\indexsubitem}{(console window method)}
f47bc5554418 mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents: 2527
diff changeset
75
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
76 \begin{funcdesc}{setmode}{mode}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
77 Set the input mode of the console to \var{C_ECHO}, etc.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
78 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
79
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
80 \begin{funcdesc}{settabs}{n}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
81 Set the tabsize to \var{n} spaces.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
82 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
83
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
84 \begin{funcdesc}{cleos}{}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
85 Clear to end-of-screen.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
86 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
87
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
88 \begin{funcdesc}{cleol}{}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
89 Clear to end-of-line.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
90 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
91
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
92 \begin{funcdesc}{inverse}{onoff}
2527
815dfaa6a778 small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents: 2453
diff changeset
93 Enable inverse-video mode:\ characters with the high bit set are
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
94 displayed in inverse video (this disables the upper half of a
2527
815dfaa6a778 small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents: 2453
diff changeset
95 non-\ASCII{} character set).
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
96 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
97
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
98 \begin{funcdesc}{gotoxy}{x\, y}
2527
815dfaa6a778 small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents: 2453
diff changeset
99 Set the cursor to position \code{(\var{x}, \var{y})}.
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
100 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
101
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
102 \begin{funcdesc}{hide}{}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
103 Hide the window, remembering the contents.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
104 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
105
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
106 \begin{funcdesc}{show}{}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
107 Show the window again.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
108 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
109
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
110 \begin{funcdesc}{echo2printer}{}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
111 Copy everything written to the window to the printer as well.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
112 \end{funcdesc}