1 \section{Built-in Module
\module{macconsole
}}
2 \label{module-macconsole
}
3 \bimodindex{macconsole
}
6 This module is available on the Macintosh, provided Python has been
7 built using the Think
\C{} compiler. It provides an interface to the
8 Think console package, with which basic text windows can be created.
10 \begin{datadesc
}{options
}
11 An object allowing you to set various options when creating windows,
15 \begin{datadesc
}{C_ECHO
}
19 Options for the
\code{setmode
} method.
\constant{C_ECHO
} and
20 \constant{C_CBREAK
} enable character echo, the other two disable it,
21 \constant{C_ECHO
} and
\constant{C_NOECHO
} enable line-oriented input
22 (erase/kill processing, etc).
25 \begin{funcdesc
}{copen
}{}
26 Open a new console window. Return a console window object.
29 \begin{funcdesc
}{fopen
}{fp
}
30 Return the console window object corresponding with the given file
31 object.
\var{fp
} should be one of
\code{sys.stdin
},
\code{sys.stdout
} or
35 \subsection{macconsole options object
}
36 These options are examined when a window is created:
38 \setindexsubitem{(macconsole option)
}
41 The origin of the window.
44 \begin{datadesc
}{nrows
}
46 The size of the window.
49 \begin{datadesc
}{txFont
}
52 The font, fontsize and fontstyle to be used in the window.
55 \begin{datadesc
}{title
}
56 The title of the window.
59 \begin{datadesc
}{pause_atexit
}
60 If set non-zero, the window will wait for user action before closing.
63 \subsection{console window object
}
65 \setindexsubitem{(console window attribute)
}
67 \begin{datadesc
}{file
}
68 The file object corresponding to this console window. If the file is
69 buffered, you should call
\code{\var{file
}.flush()
} between
70 \code{write()
} and
\code{read()
} calls.
73 \setindexsubitem{(console window method)
}
75 \begin{funcdesc
}{setmode
}{mode
}
76 Set the input mode of the console to
\constant{C_ECHO
}, etc.
79 \begin{funcdesc
}{settabs
}{n
}
80 Set the tabsize to
\var{n
} spaces.
83 \begin{funcdesc
}{cleos
}{}
84 Clear to end-of-screen.
87 \begin{funcdesc
}{cleol
}{}
91 \begin{funcdesc
}{inverse
}{onoff
}
92 Enable inverse-video mode:\ characters with the high bit set are
93 displayed in inverse video (this disables the upper half of a
94 non-
\ASCII{} character set).
97 \begin{funcdesc
}{gotoxy
}{x, y
}
98 Set the cursor to position
\code{(
\var{x
},
\var{y
})
}.
101 \begin{funcdesc
}{hide
}{}
102 Hide the window, remembering the contents.
105 \begin{funcdesc
}{show
}{}
106 Show the window again.
109 \begin{funcdesc
}{echo2printer
}{}
110 Copy everything written to the window to the printer as well.