\hypertarget{txt__window_8h}{
\section{textscreen/txt\_\-window.h File Reference}
\label{df/dc3/txt__window_8h}\index{textscreen/txt\_\-window.h@{textscreen/txt\_\-window.h}}
}


Windows.  


\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structtxt__window__s}{txt\_\-window\_\-s}
\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct \hyperlink{structtxt__window__s}{txt\_\-window\_\-s} \hyperlink{txt__window_8h_a664d043bc801de0eb60905df9354f4ec}{txt\_\-window\_\-t}
\begin{DoxyCompactList}\small\item\em A window. \end{DoxyCompactList}\item 
typedef int($\ast$ \hyperlink{txt__window_8h_a7a79bfd12ecc790a8556fbca66988956}{TxtWindowKeyPress} )(\hyperlink{structtxt__window__s}{txt\_\-window\_\-t} $\ast$window, int key, void $\ast$user\_\-data)
\item 
typedef int($\ast$ \hyperlink{txt__window_8h_a419163d5dffd61bfa999baf3aae0f5a4}{TxtWindowMousePress} )(\hyperlink{structtxt__window__s}{txt\_\-window\_\-t} $\ast$window, int \hyperlink{cl__main_8cpp_ad4dec120c8756cb4abbd4bd41f63f9bf}{x}, int \hyperlink{v__video_8cpp_a0a2f84ed7838f07779ae24c5a9086d33}{y}, int \hyperlink{client_2src_2v__palette_8cpp_a2c8b5e93edf6061940ca34185468fa03}{b}, void $\ast$user\_\-data)
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{structtxt__window__s}{txt\_\-window\_\-t} $\ast$ \hyperlink{txt__window_8h_a7b216ab71523563523a9dcc15bed153a}{TXT\_\-NewWindow} (char $\ast$title)
\begin{DoxyCompactList}\small\item\em Open a new window. \end{DoxyCompactList}\item 
void \hyperlink{txt__window_8h_aae58b0fb5541126faf78444de6393079}{TXT\_\-CloseWindow} (\hyperlink{structtxt__window__s}{txt\_\-window\_\-t} $\ast$window)
\begin{DoxyCompactList}\small\item\em Close a window. \end{DoxyCompactList}\item 
void \hyperlink{txt__window_8h_a6ca9f23c728bc59e2bfcbb05351dfb42}{TXT\_\-SetWindowPosition} (\hyperlink{structtxt__window__s}{txt\_\-window\_\-t} $\ast$window, \hyperlink{txt__widget_8h_a720fa53b6419a569e27365681bb7b634}{txt\_\-horiz\_\-align\_\-t} horiz\_\-align, \hyperlink{txt__widget_8h_a3eb807c8301cad23a9b895e8c9066e3f}{txt\_\-vert\_\-align\_\-t} vert\_\-align, int \hyperlink{cl__main_8cpp_ad4dec120c8756cb4abbd4bd41f63f9bf}{x}, int \hyperlink{v__video_8cpp_a0a2f84ed7838f07779ae24c5a9086d33}{y})
\begin{DoxyCompactList}\small\item\em Set the position of a window on the screen. \end{DoxyCompactList}\item 
void \hyperlink{txt__window_8h_a20c292ac6d9df8adbef6020b16ed0512}{TXT\_\-SetWindowAction} (\hyperlink{structtxt__window__s}{txt\_\-window\_\-t} $\ast$window, \hyperlink{txt__widget_8h_a720fa53b6419a569e27365681bb7b634}{txt\_\-horiz\_\-align\_\-t} \hyperlink{p__pspr_8cpp_a401e942526aac47cef94f478182486e7}{position}, \hyperlink{structtxt__window__action__s}{txt\_\-window\_\-action\_\-t} $\ast$action)
\begin{DoxyCompactList}\small\item\em Set a window action for a given window. \end{DoxyCompactList}\item 
void \hyperlink{txt__window_8h_a93d0669e9e8c5abb7a8e732f12075758}{TXT\_\-SetKeyListener} (\hyperlink{structtxt__window__s}{txt\_\-window\_\-t} $\ast$window, \hyperlink{txt__window_8h_a7a79bfd12ecc790a8556fbca66988956}{TxtWindowKeyPress} key\_\-listener, void $\ast$user\_\-data)
\begin{DoxyCompactList}\small\item\em Set a callback function to be invoked whenever a key is pressed within a window. \end{DoxyCompactList}\item 
void \hyperlink{txt__window_8h_a5401d8f2b3835f77e9298dcdfd0d1e32}{TXT\_\-SetMouseListener} (\hyperlink{structtxt__window__s}{txt\_\-window\_\-t} $\ast$window, \hyperlink{txt__window_8h_a419163d5dffd61bfa999baf3aae0f5a4}{TxtWindowMousePress} mouse\_\-listener, void $\ast$user\_\-data)
\begin{DoxyCompactList}\small\item\em Set a callback function to be invoked whenever a mouse button is pressed within a window. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Windows. 

\subsection{Typedef Documentation}
\hypertarget{txt__window_8h_a664d043bc801de0eb60905df9354f4ec}{
\index{txt\_\-window.h@{txt\_\-window.h}!txt\_\-window\_\-t@{txt\_\-window\_\-t}}
\index{txt\_\-window\_\-t@{txt\_\-window\_\-t}!txt_window.h@{txt\_\-window.h}}
\subsubsection[{txt\_\-window\_\-t}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf txt\_\-window\_\-s} {\bf txt\_\-window\_\-t}}}
\label{df/dc3/txt__window_8h_a664d043bc801de0eb60905df9354f4ec}


A window. 

A window contains widgets, and may also be treated as a table (\hyperlink{txt__table_8h_a9001d2874aa251fdff0a4ae97de6f1d7}{txt\_\-table\_\-t}) containing a single column.

Windows can be created using \hyperlink{txt__window_8h_a7b216ab71523563523a9dcc15bed153a}{TXT\_\-NewWindow} and closed using \hyperlink{txt__window_8h_aae58b0fb5541126faf78444de6393079}{TXT\_\-CloseWindow}. When a window is closed, it emits the \char`\"{}closed\char`\"{} signal.

In addition to the widgets within a window, windows also have a \char`\"{}tray\char`\"{} area at their bottom containing window action widgets. These widgets allow keyboard shortcuts to trigger common actions. Each window has three slots for keyboard shortcuts. By default, the left slot contains an action to close the window when the escape button is pressed, while the right slot contains an action to activate the currently-\/selected widget. \hypertarget{txt__window_8h_a7a79bfd12ecc790a8556fbca66988956}{
\index{txt\_\-window.h@{txt\_\-window.h}!TxtWindowKeyPress@{TxtWindowKeyPress}}
\index{TxtWindowKeyPress@{TxtWindowKeyPress}!txt_window.h@{txt\_\-window.h}}
\subsubsection[{TxtWindowKeyPress}]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ {\bf TxtWindowKeyPress})({\bf txt\_\-window\_\-t} $\ast$window, int key, void $\ast$user\_\-data)}}
\label{df/dc3/txt__window_8h_a7a79bfd12ecc790a8556fbca66988956}
\hypertarget{txt__window_8h_a419163d5dffd61bfa999baf3aae0f5a4}{
\index{txt\_\-window.h@{txt\_\-window.h}!TxtWindowMousePress@{TxtWindowMousePress}}
\index{TxtWindowMousePress@{TxtWindowMousePress}!txt_window.h@{txt\_\-window.h}}
\subsubsection[{TxtWindowMousePress}]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ {\bf TxtWindowMousePress})({\bf txt\_\-window\_\-t} $\ast$window, int {\bf x}, int {\bf y}, int {\bf b}, void $\ast$user\_\-data)}}
\label{df/dc3/txt__window_8h_a419163d5dffd61bfa999baf3aae0f5a4}


\subsection{Function Documentation}
\hypertarget{txt__window_8h_aae58b0fb5541126faf78444de6393079}{
\index{txt\_\-window.h@{txt\_\-window.h}!TXT\_\-CloseWindow@{TXT\_\-CloseWindow}}
\index{TXT\_\-CloseWindow@{TXT\_\-CloseWindow}!txt_window.h@{txt\_\-window.h}}
\subsubsection[{TXT\_\-CloseWindow}]{\setlength{\rightskip}{0pt plus 5cm}void TXT\_\-CloseWindow (
\begin{DoxyParamCaption}
\item[{{\bf txt\_\-window\_\-t} $\ast$}]{window}
\end{DoxyParamCaption}
)}}
\label{df/dc3/txt__window_8h_aae58b0fb5541126faf78444de6393079}


Close a window. 


\begin{DoxyParams}{Parameters}
{\em window} & Tine window to close. \\
\hline
\end{DoxyParams}
\hypertarget{txt__window_8h_a7b216ab71523563523a9dcc15bed153a}{
\index{txt\_\-window.h@{txt\_\-window.h}!TXT\_\-NewWindow@{TXT\_\-NewWindow}}
\index{TXT\_\-NewWindow@{TXT\_\-NewWindow}!txt_window.h@{txt\_\-window.h}}
\subsubsection[{TXT\_\-NewWindow}]{\setlength{\rightskip}{0pt plus 5cm}{\bf txt\_\-window\_\-t}$\ast$ TXT\_\-NewWindow (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{title}
\end{DoxyParamCaption}
)}}
\label{df/dc3/txt__window_8h_a7b216ab71523563523a9dcc15bed153a}


Open a new window. 


\begin{DoxyParams}{Parameters}
{\em title} & Title to display in the titlebar of the new window. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Pointer to a new \hyperlink{txt__window_8h_a664d043bc801de0eb60905df9354f4ec}{txt\_\-window\_\-t} structure representing the new window. 
\end{DoxyReturn}
\hypertarget{txt__window_8h_a93d0669e9e8c5abb7a8e732f12075758}{
\index{txt\_\-window.h@{txt\_\-window.h}!TXT\_\-SetKeyListener@{TXT\_\-SetKeyListener}}
\index{TXT\_\-SetKeyListener@{TXT\_\-SetKeyListener}!txt_window.h@{txt\_\-window.h}}
\subsubsection[{TXT\_\-SetKeyListener}]{\setlength{\rightskip}{0pt plus 5cm}void TXT\_\-SetKeyListener (
\begin{DoxyParamCaption}
\item[{{\bf txt\_\-window\_\-t} $\ast$}]{window, }
\item[{{\bf TxtWindowKeyPress}}]{key\_\-listener, }
\item[{void $\ast$}]{user\_\-data}
\end{DoxyParamCaption}
)}}
\label{df/dc3/txt__window_8h_a93d0669e9e8c5abb7a8e732f12075758}


Set a callback function to be invoked whenever a key is pressed within a window. 


\begin{DoxyParams}{Parameters}
{\em window} & The window. \\
\hline
{\em key\_\-listener} & Callback function. \\
\hline
{\em user\_\-data} & User-\/specified pointer to pass to the callback function. \\
\hline
\end{DoxyParams}
\hypertarget{txt__window_8h_a5401d8f2b3835f77e9298dcdfd0d1e32}{
\index{txt\_\-window.h@{txt\_\-window.h}!TXT\_\-SetMouseListener@{TXT\_\-SetMouseListener}}
\index{TXT\_\-SetMouseListener@{TXT\_\-SetMouseListener}!txt_window.h@{txt\_\-window.h}}
\subsubsection[{TXT\_\-SetMouseListener}]{\setlength{\rightskip}{0pt plus 5cm}void TXT\_\-SetMouseListener (
\begin{DoxyParamCaption}
\item[{{\bf txt\_\-window\_\-t} $\ast$}]{window, }
\item[{{\bf TxtWindowMousePress}}]{mouse\_\-listener, }
\item[{void $\ast$}]{user\_\-data}
\end{DoxyParamCaption}
)}}
\label{df/dc3/txt__window_8h_a5401d8f2b3835f77e9298dcdfd0d1e32}


Set a callback function to be invoked whenever a mouse button is pressed within a window. 


\begin{DoxyParams}{Parameters}
{\em window} & The window. \\
\hline
{\em mouse\_\-listener} & Callback function. \\
\hline
{\em user\_\-data} & User-\/specified pointer to pass to the callback function. \\
\hline
\end{DoxyParams}
\hypertarget{txt__window_8h_a20c292ac6d9df8adbef6020b16ed0512}{
\index{txt\_\-window.h@{txt\_\-window.h}!TXT\_\-SetWindowAction@{TXT\_\-SetWindowAction}}
\index{TXT\_\-SetWindowAction@{TXT\_\-SetWindowAction}!txt_window.h@{txt\_\-window.h}}
\subsubsection[{TXT\_\-SetWindowAction}]{\setlength{\rightskip}{0pt plus 5cm}void TXT\_\-SetWindowAction (
\begin{DoxyParamCaption}
\item[{{\bf txt\_\-window\_\-t} $\ast$}]{window, }
\item[{{\bf txt\_\-horiz\_\-align\_\-t}}]{position, }
\item[{{\bf txt\_\-window\_\-action\_\-t} $\ast$}]{action}
\end{DoxyParamCaption}
)}}
\label{df/dc3/txt__window_8h_a20c292ac6d9df8adbef6020b16ed0512}


Set a window action for a given window. 

Each window can have up to three window actions, which provide keyboard shortcuts that can be used within a given window.


\begin{DoxyParams}{Parameters}
{\em window} & The window. \\
\hline
{\em position} & The window action slot to set (left, center or right). \\
\hline
{\em action} & The window action widget. If this is NULL, any current window action in the given slot is removed. \\
\hline
\end{DoxyParams}
\hypertarget{txt__window_8h_a6ca9f23c728bc59e2bfcbb05351dfb42}{
\index{txt\_\-window.h@{txt\_\-window.h}!TXT\_\-SetWindowPosition@{TXT\_\-SetWindowPosition}}
\index{TXT\_\-SetWindowPosition@{TXT\_\-SetWindowPosition}!txt_window.h@{txt\_\-window.h}}
\subsubsection[{TXT\_\-SetWindowPosition}]{\setlength{\rightskip}{0pt plus 5cm}void TXT\_\-SetWindowPosition (
\begin{DoxyParamCaption}
\item[{{\bf txt\_\-window\_\-t} $\ast$}]{window, }
\item[{{\bf txt\_\-horiz\_\-align\_\-t}}]{horiz\_\-align, }
\item[{{\bf txt\_\-vert\_\-align\_\-t}}]{vert\_\-align, }
\item[{int}]{x, }
\item[{int}]{y}
\end{DoxyParamCaption}
)}}
\label{df/dc3/txt__window_8h_a6ca9f23c728bc59e2bfcbb05351dfb42}


Set the position of a window on the screen. 

The window is specified as coordinates relative to a predefined position on the screen (eg. center of the screen, top left of the screen, etc).


\begin{DoxyParams}{Parameters}
{\em window} & The window. \\
\hline
{\em horiz\_\-align} & Horizontal position on the screen to which the coordinates are relative (left side, right side or center). \\
\hline
{\em vert\_\-align} & Vertical position on the screen to which the coordinates are relative (top, bottom or center). \\
\hline
{\em x} & X coordinate (horizonal axis) for window position. \\
\hline
{\em y} & Y coordinate (vertical axis) for window position. \\
\hline
\end{DoxyParams}
