Skip to content

Commit 0aa3b33

Browse files
[3.13] gh-87904: Document curses classes (GH-151643) (GH-153752)
Document the panel class and its error exception in curses.panel.rst, using the real lowercase panel name. (cherry picked from commit 560ff8e) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 824df7f commit 0aa3b33

1 file changed

Lines changed: 44 additions & 18 deletions

File tree

Doc/library/curses.panel.rst

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ displayed. Panels can be added, moved up or down in the stack, and removed.
1818
Functions
1919
---------
2020

21-
The module :mod:`curses.panel` defines the following functions:
21+
The module :mod:`!curses.panel` defines the following exception:
22+
23+
24+
.. exception:: error
25+
26+
Exception raised when a curses panel library function returns an error.
27+
28+
29+
The module :mod:`!curses.panel` defines the following functions:
2230

2331

2432
.. function:: bottom_panel()
@@ -50,73 +58,91 @@ The module :mod:`curses.panel` defines the following functions:
5058
Panel objects
5159
-------------
5260

53-
Panel objects, as returned by :func:`new_panel` above, are windows with a
54-
stacking order. There's always a window associated with a panel which determines
55-
the content, while the panel methods are responsible for the window's depth in
56-
the panel stack.
61+
.. raw:: html
62+
63+
<!-- Keep the old URL fragments working (see gh-89554) -->
64+
<span id='curses.panel.Panel.above'></span>
65+
<span id='curses.panel.Panel.below'></span>
66+
<span id='curses.panel.Panel.bottom'></span>
67+
<span id='curses.panel.Panel.hidden'></span>
68+
<span id='curses.panel.Panel.hide'></span>
69+
<span id='curses.panel.Panel.move'></span>
70+
<span id='curses.panel.Panel.replace'></span>
71+
<span id='curses.panel.Panel.set_userptr'></span>
72+
<span id='curses.panel.Panel.show'></span>
73+
<span id='curses.panel.Panel.top'></span>
74+
<span id='curses.panel.Panel.userptr'></span>
75+
<span id='curses.panel.Panel.window'></span>
76+
77+
.. class:: panel
78+
79+
Panel objects, as returned by :func:`new_panel` above, are windows with a
80+
stacking order. There's always a window associated with a panel which
81+
determines the content, while the panel methods are responsible for the
82+
window's depth in the panel stack.
5783

58-
Panel objects have the following methods:
84+
Panel objects have the following methods:
5985

6086

61-
.. method:: Panel.above()
87+
.. method:: panel.above()
6288

6389
Returns the panel above the current panel.
6490

6591

66-
.. method:: Panel.below()
92+
.. method:: panel.below()
6793

6894
Returns the panel below the current panel.
6995

7096

71-
.. method:: Panel.bottom()
97+
.. method:: panel.bottom()
7298

7399
Push the panel to the bottom of the stack.
74100

75101

76-
.. method:: Panel.hidden()
102+
.. method:: panel.hidden()
77103

78104
Returns ``True`` if the panel is hidden (not visible), ``False`` otherwise.
79105

80106

81-
.. method:: Panel.hide()
107+
.. method:: panel.hide()
82108

83109
Hide the panel. This does not delete the object, it just makes the window on
84110
screen invisible.
85111

86112

87-
.. method:: Panel.move(y, x)
113+
.. method:: panel.move(y, x)
88114

89115
Move the panel to the screen coordinates ``(y, x)``.
90116

91117

92-
.. method:: Panel.replace(win)
118+
.. method:: panel.replace(win)
93119

94120
Change the window associated with the panel to the window *win*.
95121

96122

97-
.. method:: Panel.set_userptr(obj)
123+
.. method:: panel.set_userptr(obj)
98124

99125
Set the panel's user pointer to *obj*. This is used to associate an arbitrary
100126
piece of data with the panel, and can be any Python object.
101127

102128

103-
.. method:: Panel.show()
129+
.. method:: panel.show()
104130

105131
Display the panel (which might have been hidden), placing it on top of
106132
the panel stack.
107133

108134

109-
.. method:: Panel.top()
135+
.. method:: panel.top()
110136

111137
Push panel to the top of the stack.
112138

113139

114-
.. method:: Panel.userptr()
140+
.. method:: panel.userptr()
115141

116142
Returns the user pointer for the panel. This might be any Python object.
117143

118144

119-
.. method:: Panel.window()
145+
.. method:: panel.window()
120146

121147
Returns the window object associated with the panel.
122148

0 commit comments

Comments
 (0)