1 \section{\module{macconsole
} ---
2 Think C's console package
}
4 \declaremodule{builtin
}{macconsole
}
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,
18 \begin{datadesc
}{C_ECHO
}
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).
28 \begin{funcdesc
}{copen
}{}
29 Open a new console window. Return a console window object.
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
38 \subsection{macconsole options object
}
39 These options are examined when a window is created:
41 \setindexsubitem{(macconsole option)
}
44 The origin of the window.
47 \begin{datadesc
}{nrows
}
49 The size of the window.
52 \begin{datadesc
}{txFont
}
55 The font, fontsize and fontstyle to be used in the window.
58 \begin{datadesc
}{title
}
59 The title of the window.
62 \begin{datadesc
}{pause_atexit
}
63 If set non-zero, the window will wait for user action before closing.
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.
76 \setindexsubitem{(console window method)
}
78 \begin{funcdesc
}{setmode
}{mode
}
79 Set the input mode of the console to
\constant{C_ECHO
}, etc.
82 \begin{funcdesc
}{settabs
}{n
}
83 Set the tabsize to
\var{n
} spaces.
86 \begin{funcdesc
}{cleos
}{}
87 Clear to end-of-screen.
90 \begin{funcdesc
}{cleol
}{}
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).
100 \begin{funcdesc
}{gotoxy
}{x, y
}
101 Set the cursor to position
\code{(
\var{x
},
\var{y
})
}.
104 \begin{funcdesc
}{hide
}{}
105 Hide the window, remembering the contents.
108 \begin{funcdesc
}{show
}{}
109 Show the window again.
112 \begin{funcdesc
}{echo2printer
}{}
113 Copy everything written to the window to the printer as well.