2000-12-22 17:57:42 -04:00
|
|
|
\section{\module{curses.panel} ---
|
|
|
|
A panel stack extension for curses.}
|
|
|
|
|
|
|
|
\declaremodule{standard}{curses.panel}
|
2002-10-30 17:08:34 -04:00
|
|
|
\sectionauthor{A.M. Kuchling}{amk@amk.ca}
|
2000-12-22 17:57:42 -04:00
|
|
|
\modulesynopsis{A panel stack extension that adds depth to
|
|
|
|
curses windows.}
|
|
|
|
|
|
|
|
Panels are windows with the added feature of depth, so they can be
|
|
|
|
stacked on top of each other, and only the visible portions of
|
|
|
|
each window will be displayed. Panels can be added, moved up
|
|
|
|
or down in the stack, and removed.
|
|
|
|
|
|
|
|
\subsection{Functions \label{cursespanel-functions}}
|
|
|
|
|
|
|
|
The module \module{curses.panel} defines the following functions:
|
|
|
|
|
|
|
|
|
|
|
|
\begin{funcdesc}{bottom_panel}{}
|
|
|
|
Returns the bottom panel in the panel stack.
|
|
|
|
\end{funcdesc}
|
|
|
|
|
2001-03-29 18:22:23 -04:00
|
|
|
\begin{funcdesc}{new_panel}{win}
|
2000-12-22 17:57:42 -04:00
|
|
|
Returns a panel object, associating it with the given window \var{win}.
|
2006-05-10 13:11:44 -03:00
|
|
|
Be aware that you need to keep the returned panel object referenced
|
|
|
|
explicitly. If you don't, the panel object is garbage collected and
|
|
|
|
removed from the panel stack.
|
2001-03-29 18:22:23 -04:00
|
|
|
\end{funcdesc}
|
2000-12-22 17:57:42 -04:00
|
|
|
|
|
|
|
\begin{funcdesc}{top_panel}{}
|
|
|
|
Returns the top panel in the panel stack.
|
|
|
|
\end{funcdesc}
|
|
|
|
|
|
|
|
\begin{funcdesc}{update_panels}{}
|
|
|
|
Updates the virtual screen after changes in the panel stack. This does
|
|
|
|
not call \function{curses.doupdate()}, so you'll have to do this yourself.
|
|
|
|
\end{funcdesc}
|
|
|
|
|
|
|
|
\subsection{Panel Objects \label{curses-panel-objects}}
|
|
|
|
|
|
|
|
Panel objects, as returned by \function{new_panel()} above, are windows
|
|
|
|
with a stacking order. There's always a window associated with a
|
|
|
|
panel which determines the content, while the panel methods are
|
|
|
|
responsible for the window's depth in the panel stack.
|
|
|
|
|
|
|
|
Panel objects have the following methods:
|
|
|
|
|
2001-03-29 18:22:23 -04:00
|
|
|
\begin{methoddesc}{above}{}
|
2000-12-22 17:57:42 -04:00
|
|
|
Returns the panel above the current panel.
|
|
|
|
\end{methoddesc}
|
|
|
|
|
2001-03-29 18:22:23 -04:00
|
|
|
\begin{methoddesc}{below}{}
|
2000-12-22 17:57:42 -04:00
|
|
|
Returns the panel below the current panel.
|
|
|
|
\end{methoddesc}
|
|
|
|
|
2001-03-29 18:22:23 -04:00
|
|
|
\begin{methoddesc}{bottom}{}
|
2000-12-22 17:57:42 -04:00
|
|
|
Push the panel to the bottom of the stack.
|
|
|
|
\end{methoddesc}
|
|
|
|
|
2001-03-29 18:22:23 -04:00
|
|
|
\begin{methoddesc}{hidden}{}
|
2000-12-22 17:57:42 -04:00
|
|
|
Returns true if the panel is hidden (not visible), false otherwise.
|
|
|
|
\end{methoddesc}
|
|
|
|
|
2001-03-29 18:22:23 -04:00
|
|
|
\begin{methoddesc}{hide}{}
|
2000-12-22 17:57:42 -04:00
|
|
|
Hide the panel. This does not delete the object, it just makes the
|
|
|
|
window on screen invisible.
|
|
|
|
\end{methoddesc}
|
|
|
|
|
|
|
|
\begin{methoddesc}{move}{y, x}
|
|
|
|
Move the panel to the screen coordinates \code{(\var{y}, \var{x})}.
|
|
|
|
\end{methoddesc}
|
|
|
|
|
|
|
|
\begin{methoddesc}{replace}{win}
|
|
|
|
Change the window associated with the panel to the window \var{win}.
|
|
|
|
\end{methoddesc}
|
|
|
|
|
|
|
|
\begin{methoddesc}{set_userptr}{obj}
|
|
|
|
Set the panel's user pointer to \var{obj}. This is used to associate an
|
|
|
|
arbitrary piece of data with the panel, and can be any Python object.
|
|
|
|
\end{methoddesc}
|
|
|
|
|
2001-03-29 18:22:23 -04:00
|
|
|
\begin{methoddesc}{show}{}
|
2000-12-22 17:57:42 -04:00
|
|
|
Display the panel (which might have been hidden).
|
|
|
|
\end{methoddesc}
|
|
|
|
|
2001-03-29 18:22:23 -04:00
|
|
|
\begin{methoddesc}{top}{}
|
2000-12-22 17:57:42 -04:00
|
|
|
Push panel to the top of the stack.
|
|
|
|
\end{methoddesc}
|
|
|
|
|
2001-03-29 18:22:23 -04:00
|
|
|
\begin{methoddesc}{userptr}{}
|
2000-12-22 17:57:42 -04:00
|
|
|
Returns the user pointer for the panel. This might be any Python object.
|
|
|
|
\end{methoddesc}
|
|
|
|
|
2001-03-29 18:22:23 -04:00
|
|
|
\begin{methoddesc}{window}{}
|
2000-12-22 17:57:42 -04:00
|
|
|
Returns the window object associated with the panel.
|
|
|
|
\end{methoddesc}
|