Merged release21-maint changes.
[python/dscho.git] / Doc / mac / libmacconsole.tex
blob6215d899260153882508f98bffd0bd58e32c646e
1 \section{\module{macconsole} ---
2 Think C's console package}
4 \declaremodule{builtin}{macconsole}
5 \platform{Mac}
6 \modulesynopsis{Think C's console package.}
9 This module is available on the Macintosh, provided Python has been
10 built using the Think C compiler. It provides an interface to the
11 Think console package, with which basic text windows can be created.
13 \begin{datadesc}{options}
14 An object allowing you to set various options when creating windows,
15 see below.
16 \end{datadesc}
18 \begin{datadesc}{C_ECHO}
19 \dataline{C_NOECHO}
20 \dataline{C_CBREAK}
21 \dataline{C_RAW}
22 Options for the \code{setmode} method. \constant{C_ECHO} and
23 \constant{C_CBREAK} enable character echo, the other two disable it,
24 \constant{C_ECHO} and \constant{C_NOECHO} enable line-oriented input
25 (erase/kill processing, etc).
26 \end{datadesc}
28 \begin{funcdesc}{copen}{}
29 Open a new console window. Return a console window object.
30 \end{funcdesc}
32 \begin{funcdesc}{fopen}{fp}
33 Return the console window object corresponding with the given file
34 object. \var{fp} should be one of \code{sys.stdin}, \code{sys.stdout} or
35 \code{sys.stderr}.
36 \end{funcdesc}
38 \subsection{macconsole options object}
39 These options are examined when a window is created:
41 \setindexsubitem{(macconsole option)}
42 \begin{datadesc}{top}
43 \dataline{left}
44 The origin of the window.
45 \end{datadesc}
47 \begin{datadesc}{nrows}
48 \dataline{ncols}
49 The size of the window.
50 \end{datadesc}
52 \begin{datadesc}{txFont}
53 \dataline{txSize}
54 \dataline{txStyle}
55 The font, fontsize and fontstyle to be used in the window.
56 \end{datadesc}
58 \begin{datadesc}{title}
59 The title of the window.
60 \end{datadesc}
62 \begin{datadesc}{pause_atexit}
63 If set non-zero, the window will wait for user action before closing.
64 \end{datadesc}
66 \subsection{console window object}
68 \setindexsubitem{(console window attribute)}
70 \begin{datadesc}{file}
71 The file object corresponding to this console window. If the file is
72 buffered, you should call \code{\var{file}.flush()} between
73 \code{write()} and \code{read()} calls.
74 \end{datadesc}
76 \setindexsubitem{(console window method)}
78 \begin{funcdesc}{setmode}{mode}
79 Set the input mode of the console to \constant{C_ECHO}, etc.
80 \end{funcdesc}
82 \begin{funcdesc}{settabs}{n}
83 Set the tabsize to \var{n} spaces.
84 \end{funcdesc}
86 \begin{funcdesc}{cleos}{}
87 Clear to end-of-screen.
88 \end{funcdesc}
90 \begin{funcdesc}{cleol}{}
91 Clear to end-of-line.
92 \end{funcdesc}
94 \begin{funcdesc}{inverse}{onoff}
95 Enable inverse-video mode:\ characters with the high bit set are
96 displayed in inverse video (this disables the upper half of a
97 non-\ASCII{} character set).
98 \end{funcdesc}
100 \begin{funcdesc}{gotoxy}{x, y}
101 Set the cursor to position \code{(\var{x}, \var{y})}.
102 \end{funcdesc}
104 \begin{funcdesc}{hide}{}
105 Hide the window, remembering the contents.
106 \end{funcdesc}
108 \begin{funcdesc}{show}{}
109 Show the window again.
110 \end{funcdesc}
112 \begin{funcdesc}{echo2printer}{}
113 Copy everything written to the window to the printer as well.
114 \end{funcdesc}