cpython-withatomic / Doc / libmacconsole.tex

The branch 'legacy-trunk' does not exist.
\section{Built-in Module \sectcode{macconsole}}

\renewcommand{\indexsubitem}{(in module macconsole)}

This module is available on the Macintosh, provided Python has been
built using the Think C compiler. It provides an interface to the
Think console package, with which basic text windows can be created.

An object allowing you to set various options when creating windows,
see below.

Options for the \code{setmode} method. \var{C_ECHO} and \var{C_CBREAK}
enable character echo, the other two disable it, \var{C_ECHO} and
\var{C_NOECHO} enable line-oriented input (erase/kill processing,

Open a new console window. Return a console window object.

Return the console window object corresponding with the given file
object. \var{fp} should be one of \code{sys.stdin}, \code{sys.stdout} or

\subsection{macconsole options object}
These options are examined when a window is created:

\renewcommand{\indexsubitem}{(macconsole option)}
The origin of the window.

The size of the window.

The font, fontsize and fontstyle to be used in the window.

The title of the window.

If set non-zero, the window will wait for user action before closing.

\subsection{console window object}

\renewcommand{\indexsubitem}{(console window attribute)}

The file object corresponding to this console window. If the file is
buffered, you should call \code{file.flush()} between \code{write()}
and \code{read()} calls.

\renewcommand{\indexsubitem}{(console window method)}

Set the input mode of the console to \var{C_ECHO}, etc.

Set the tabsize to \var{n} spaces.

Clear to end-of-screen.

Clear to end-of-line.

Enable inverse-video mode:\ characters with the high bit set are
displayed in inverse video (this disables the upper half of a
non-\ASCII{} character set).

\begin{funcdesc}{gotoxy}{x\, y}
Set the cursor to position \code{(\var{x}, \var{y})}.

Hide the window, remembering the contents.

Show the window again.

Copy everything written to the window to the printer as well.