blob: 14d83e3535ed13e75f0ee2fcee7bcc83055e0a8e [file] [log] [blame]
Andrew M. Kuchling676634b2000-12-22 21:57:42 +00001\section{\module{curses.panel} ---
2 A panel stack extension for curses.}
3
4\declaremodule{standard}{curses.panel}
Andrew M. Kuchling3adefcc2002-10-30 21:08:34 +00005\sectionauthor{A.M. Kuchling}{amk@amk.ca}
Andrew M. Kuchling676634b2000-12-22 21:57:42 +00006\modulesynopsis{A panel stack extension that adds depth to
7 curses windows.}
8
9Panels are windows with the added feature of depth, so they can be
10stacked on top of each other, and only the visible portions of
11each window will be displayed. Panels can be added, moved up
12or down in the stack, and removed.
13
14\subsection{Functions \label{cursespanel-functions}}
15
16The module \module{curses.panel} defines the following functions:
17
18
19\begin{funcdesc}{bottom_panel}{}
20Returns the bottom panel in the panel stack.
21\end{funcdesc}
22
Fred Drake14631f62001-03-29 22:22:23 +000023\begin{funcdesc}{new_panel}{win}
Andrew M. Kuchling676634b2000-12-22 21:57:42 +000024Returns a panel object, associating it with the given window \var{win}.
Thomas Wouters477c8d52006-05-27 19:21:47 +000025Be aware that you need to keep the returned panel object referenced
26explicitly. If you don't, the panel object is garbage collected and
27removed from the panel stack.
Fred Drake14631f62001-03-29 22:22:23 +000028\end{funcdesc}
Andrew M. Kuchling676634b2000-12-22 21:57:42 +000029
30\begin{funcdesc}{top_panel}{}
31Returns the top panel in the panel stack.
32\end{funcdesc}
33
34\begin{funcdesc}{update_panels}{}
35Updates the virtual screen after changes in the panel stack. This does
36not call \function{curses.doupdate()}, so you'll have to do this yourself.
37\end{funcdesc}
38
39\subsection{Panel Objects \label{curses-panel-objects}}
40
41Panel objects, as returned by \function{new_panel()} above, are windows
42with a stacking order. There's always a window associated with a
43panel which determines the content, while the panel methods are
44responsible for the window's depth in the panel stack.
45
46Panel objects have the following methods:
47
Guido van Rossumd8faa362007-04-27 19:54:29 +000048\begin{methoddesc}[Panel]{above}{}
Andrew M. Kuchling676634b2000-12-22 21:57:42 +000049Returns the panel above the current panel.
50\end{methoddesc}
51
Guido van Rossumd8faa362007-04-27 19:54:29 +000052\begin{methoddesc}[Panel]{below}{}
Andrew M. Kuchling676634b2000-12-22 21:57:42 +000053Returns the panel below the current panel.
54\end{methoddesc}
55
Guido van Rossumd8faa362007-04-27 19:54:29 +000056\begin{methoddesc}[Panel]{bottom}{}
Andrew M. Kuchling676634b2000-12-22 21:57:42 +000057Push the panel to the bottom of the stack.
58\end{methoddesc}
59
Guido van Rossumd8faa362007-04-27 19:54:29 +000060\begin{methoddesc}[Panel]{hidden}{}
Andrew M. Kuchling676634b2000-12-22 21:57:42 +000061Returns true if the panel is hidden (not visible), false otherwise.
62\end{methoddesc}
63
Guido van Rossumd8faa362007-04-27 19:54:29 +000064\begin{methoddesc}[Panel]{hide}{}
Andrew M. Kuchling676634b2000-12-22 21:57:42 +000065Hide the panel. This does not delete the object, it just makes the
66window on screen invisible.
67\end{methoddesc}
68
Guido van Rossumd8faa362007-04-27 19:54:29 +000069\begin{methoddesc}[Panel]{move}{y, x}
Andrew M. Kuchling676634b2000-12-22 21:57:42 +000070Move the panel to the screen coordinates \code{(\var{y}, \var{x})}.
71\end{methoddesc}
72
Guido van Rossumd8faa362007-04-27 19:54:29 +000073\begin{methoddesc}[Panel]{replace}{win}
Andrew M. Kuchling676634b2000-12-22 21:57:42 +000074Change the window associated with the panel to the window \var{win}.
75\end{methoddesc}
76
Guido van Rossumd8faa362007-04-27 19:54:29 +000077\begin{methoddesc}[Panel]{set_userptr}{obj}
Andrew M. Kuchling676634b2000-12-22 21:57:42 +000078Set the panel's user pointer to \var{obj}. This is used to associate an
79arbitrary piece of data with the panel, and can be any Python object.
80\end{methoddesc}
81
Guido van Rossumd8faa362007-04-27 19:54:29 +000082\begin{methoddesc}[Panel]{show}{}
Andrew M. Kuchling676634b2000-12-22 21:57:42 +000083Display the panel (which might have been hidden).
84\end{methoddesc}
85
Guido van Rossumd8faa362007-04-27 19:54:29 +000086\begin{methoddesc}[Panel]{top}{}
Andrew M. Kuchling676634b2000-12-22 21:57:42 +000087Push panel to the top of the stack.
88\end{methoddesc}
89
Guido van Rossumd8faa362007-04-27 19:54:29 +000090\begin{methoddesc}[Panel]{userptr}{}
Andrew M. Kuchling676634b2000-12-22 21:57:42 +000091Returns the user pointer for the panel. This might be any Python object.
92\end{methoddesc}
93
Guido van Rossumd8faa362007-04-27 19:54:29 +000094\begin{methoddesc}[Panel]{window}{}
Andrew M. Kuchling676634b2000-12-22 21:57:42 +000095Returns the window object associated with the panel.
96\end{methoddesc}