Andrew M. Kuchling | 676634b | 2000-12-22 21:57:42 +0000 | [diff] [blame] | 1 | \section{\module{curses.panel} --- |
| 2 | A panel stack extension for curses.} |
| 3 | |
| 4 | \declaremodule{standard}{curses.panel} |
Andrew M. Kuchling | 4794f0b | 2001-11-05 21:31:33 +0000 | [diff] [blame] | 5 | \sectionauthor{A.M. Kuchling}{akuchlin@mems-exchange.org} |
Andrew M. Kuchling | 676634b | 2000-12-22 21:57:42 +0000 | [diff] [blame] | 6 | \modulesynopsis{A panel stack extension that adds depth to |
| 7 | curses windows.} |
| 8 | |
| 9 | Panels are windows with the added feature of depth, so they can be |
| 10 | stacked on top of each other, and only the visible portions of |
| 11 | each window will be displayed. Panels can be added, moved up |
| 12 | or down in the stack, and removed. |
| 13 | |
| 14 | \subsection{Functions \label{cursespanel-functions}} |
| 15 | |
| 16 | The module \module{curses.panel} defines the following functions: |
| 17 | |
| 18 | |
| 19 | \begin{funcdesc}{bottom_panel}{} |
| 20 | Returns the bottom panel in the panel stack. |
| 21 | \end{funcdesc} |
| 22 | |
Fred Drake | 14631f6 | 2001-03-29 22:22:23 +0000 | [diff] [blame] | 23 | \begin{funcdesc}{new_panel}{win} |
Andrew M. Kuchling | 676634b | 2000-12-22 21:57:42 +0000 | [diff] [blame] | 24 | Returns a panel object, associating it with the given window \var{win}. |
Fred Drake | 14631f6 | 2001-03-29 22:22:23 +0000 | [diff] [blame] | 25 | \end{funcdesc} |
Andrew M. Kuchling | 676634b | 2000-12-22 21:57:42 +0000 | [diff] [blame] | 26 | |
| 27 | \begin{funcdesc}{top_panel}{} |
| 28 | Returns the top panel in the panel stack. |
| 29 | \end{funcdesc} |
| 30 | |
| 31 | \begin{funcdesc}{update_panels}{} |
| 32 | Updates the virtual screen after changes in the panel stack. This does |
| 33 | not call \function{curses.doupdate()}, so you'll have to do this yourself. |
| 34 | \end{funcdesc} |
| 35 | |
| 36 | \subsection{Panel Objects \label{curses-panel-objects}} |
| 37 | |
| 38 | Panel objects, as returned by \function{new_panel()} above, are windows |
| 39 | with a stacking order. There's always a window associated with a |
| 40 | panel which determines the content, while the panel methods are |
| 41 | responsible for the window's depth in the panel stack. |
| 42 | |
| 43 | Panel objects have the following methods: |
| 44 | |
Fred Drake | 14631f6 | 2001-03-29 22:22:23 +0000 | [diff] [blame] | 45 | \begin{methoddesc}{above}{} |
Andrew M. Kuchling | 676634b | 2000-12-22 21:57:42 +0000 | [diff] [blame] | 46 | Returns the panel above the current panel. |
| 47 | \end{methoddesc} |
| 48 | |
Fred Drake | 14631f6 | 2001-03-29 22:22:23 +0000 | [diff] [blame] | 49 | \begin{methoddesc}{below}{} |
Andrew M. Kuchling | 676634b | 2000-12-22 21:57:42 +0000 | [diff] [blame] | 50 | Returns the panel below the current panel. |
| 51 | \end{methoddesc} |
| 52 | |
Fred Drake | 14631f6 | 2001-03-29 22:22:23 +0000 | [diff] [blame] | 53 | \begin{methoddesc}{bottom}{} |
Andrew M. Kuchling | 676634b | 2000-12-22 21:57:42 +0000 | [diff] [blame] | 54 | Push the panel to the bottom of the stack. |
| 55 | \end{methoddesc} |
| 56 | |
Fred Drake | 14631f6 | 2001-03-29 22:22:23 +0000 | [diff] [blame] | 57 | \begin{methoddesc}{hidden}{} |
Andrew M. Kuchling | 676634b | 2000-12-22 21:57:42 +0000 | [diff] [blame] | 58 | Returns true if the panel is hidden (not visible), false otherwise. |
| 59 | \end{methoddesc} |
| 60 | |
Fred Drake | 14631f6 | 2001-03-29 22:22:23 +0000 | [diff] [blame] | 61 | \begin{methoddesc}{hide}{} |
Andrew M. Kuchling | 676634b | 2000-12-22 21:57:42 +0000 | [diff] [blame] | 62 | Hide the panel. This does not delete the object, it just makes the |
| 63 | window on screen invisible. |
| 64 | \end{methoddesc} |
| 65 | |
| 66 | \begin{methoddesc}{move}{y, x} |
| 67 | Move the panel to the screen coordinates \code{(\var{y}, \var{x})}. |
| 68 | \end{methoddesc} |
| 69 | |
| 70 | \begin{methoddesc}{replace}{win} |
| 71 | Change the window associated with the panel to the window \var{win}. |
| 72 | \end{methoddesc} |
| 73 | |
| 74 | \begin{methoddesc}{set_userptr}{obj} |
| 75 | Set the panel's user pointer to \var{obj}. This is used to associate an |
| 76 | arbitrary piece of data with the panel, and can be any Python object. |
| 77 | \end{methoddesc} |
| 78 | |
Fred Drake | 14631f6 | 2001-03-29 22:22:23 +0000 | [diff] [blame] | 79 | \begin{methoddesc}{show}{} |
Andrew M. Kuchling | 676634b | 2000-12-22 21:57:42 +0000 | [diff] [blame] | 80 | Display the panel (which might have been hidden). |
| 81 | \end{methoddesc} |
| 82 | |
Fred Drake | 14631f6 | 2001-03-29 22:22:23 +0000 | [diff] [blame] | 83 | \begin{methoddesc}{top}{} |
Andrew M. Kuchling | 676634b | 2000-12-22 21:57:42 +0000 | [diff] [blame] | 84 | Push panel to the top of the stack. |
| 85 | \end{methoddesc} |
| 86 | |
Fred Drake | 14631f6 | 2001-03-29 22:22:23 +0000 | [diff] [blame] | 87 | \begin{methoddesc}{userptr}{} |
Andrew M. Kuchling | 676634b | 2000-12-22 21:57:42 +0000 | [diff] [blame] | 88 | Returns the user pointer for the panel. This might be any Python object. |
| 89 | \end{methoddesc} |
| 90 | |
Fred Drake | 14631f6 | 2001-03-29 22:22:23 +0000 | [diff] [blame] | 91 | \begin{methoddesc}{window}{} |
Andrew M. Kuchling | 676634b | 2000-12-22 21:57:42 +0000 | [diff] [blame] | 92 | Returns the window object associated with the panel. |
| 93 | \end{methoddesc} |