📄 reference.html
字号:
<br>Returns (head rows, foot rows),(orig head, orig foot).<br>orig head/foot are from rows() calls.</tt></dd></dl><dl><dt><a name="Frame-get_body"><strong>get_body</strong></a>(self)</dt></dl><dl><dt><a name="Frame-get_footer"><strong>get_footer</strong></a>(self)</dt></dl><dl><dt><a name="Frame-get_header"><strong>get_header</strong></a>(self)</dt></dl><dl><dt><a name="Frame-keypress"><strong>keypress</strong></a>(self, (maxcol, maxrow), key)</dt><dd><tt>Pass keypress to widget in focus.</tt></dd></dl><dl><dt><a name="Frame-mouse_event"><strong>mouse_event</strong></a>(self, (maxcol, maxrow), event, button, col, row, focus)</dt><dd><tt>Pass mouse event to appropriate part of frame.<br>Focus may be changed on button 1 press.</tt></dd></dl><dl><dt><a name="Frame-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl><dl><dt><a name="Frame-set_body"><strong>set_body</strong></a>(self, body)</dt></dl><dl><dt><a name="Frame-set_focus"><strong>set_focus</strong></a>(self, part)</dt><dd><tt>Set the part of the frame that is in focus.<br> <br>part -- 'header', 'footer' or 'body'</tt></dd></dl><dl><dt><a name="Frame-set_footer"><strong>set_footer</strong></a>(self, footer)</dt></dl><dl><dt><a name="Frame-set_header"><strong>set_header</strong></a>(self, header)</dt></dl><hr>Data descriptors defined here:<br><dl><dt><strong>body</strong></dt></dl><dl><dt><strong>footer</strong></dt></dl><dl><dt><strong>header</strong></dt></dl><hr>Methods inherited from Widget:<br><dl><dt><a name="Frame-selectable"><strong>selectable</strong></a>(self)</dt></dl><hr>Data descriptors inherited from Widget:<br><dl><dt><strong>__dict__</strong></dt><dd><tt>dictionary for instance variables (if defined)</tt></dd></dl><dl><dt><strong>__weakref__</strong></dt><dd><tt>list of weak references to the object (if defined)</tt></dd></dl><hr>Data and other attributes inherited from Widget:<br><dl><dt><strong>__metaclass__</strong> = <class 'urwid.widget.WidgetMeta'><dd><tt>Automatic caching of render and rows methods.<br> <br>Class variable no_cache is a list of names of methods to not cache.<br>Class variable ignore_focus if defined and True indicates that this<br>widget is not affected by the focus parameter, so it may be ignored<br>when caching.</tt></dl><a name="Filler"></a><h3>function Filler <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="Filler">class <strong>Filler</strong></a>(BoxWidget) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt><dd>Filler</dd><dd>BoxWidget</dd><dd>Widget</dd><dd>object</dd></dl><hr>Methods defined here:<br><dl><dt><a name="Filler-__init__"><strong>__init__</strong></a>(self, body, valign<font color="#909090">='middle'</font>, height<font color="#909090">=None</font>, min_height<font color="#909090">=None</font>)</dt><dd><tt>body -- a flow widget or box widget to be filled around<br>valign -- one of:<br> 'top', 'middle', 'bottom'<br> ('fixed top', rows)<br> ('fixed bottom', rows)<br> ('relative', percentage 0=top 100=bottom)<br>height -- one of:<br> None if body is a flow widget<br> number of rows high <br> ('fixed bottom', rows) Only if valign is 'fixed top'<br> ('fixed top', rows) Only if valign is 'fixed bottom'<br> ('relative', percentage of total height)<br>min_height -- one of:<br> None if no minimum or if body is a flow widget<br> minimum number of rows for the widget when height not fixed<br> <br>If body is a flow widget then height and min_height must be set<br>to None.<br> <br>Filler widgets will try to satisfy height argument first by<br>reducing the valign amount when necessary. If height still <br>cannot be satisfied it will also be reduced.</tt></dd></dl><dl><dt><a name="Filler-filler_values"><strong>filler_values</strong></a>(self, (maxcol, maxrow), focus)</dt><dd><tt>Return the number of rows to pad on the top and bottom.<br> <br>Override this method to define custom padding behaviour.</tt></dd></dl><dl><dt><a name="Filler-get_body"><strong>get_body</strong></a>(self)</dt></dl><dl><dt><a name="Filler-get_cursor_coords"><strong>get_cursor_coords</strong></a>(self, (maxcol, maxrow))</dt><dd><tt>Return cursor coords from self.<strong>body</strong> if any.</tt></dd></dl><dl><dt><a name="Filler-get_pref_col"><strong>get_pref_col</strong></a>(self, (maxcol, maxrow))</dt><dd><tt>Return pref_col from self.<strong>body</strong> if any.</tt></dd></dl><dl><dt><a name="Filler-keypress"><strong>keypress</strong></a>(self, (maxcol, maxrow), key)</dt><dd><tt>Pass keypress to self.<strong>body</strong>.</tt></dd></dl><dl><dt><a name="Filler-mouse_event"><strong>mouse_event</strong></a>(self, (maxcol, maxrow), event, button, col, row, focus)</dt><dd><tt>Pass to self.<strong>body</strong>.</tt></dd></dl><dl><dt><a name="Filler-move_cursor_to_coords"><strong>move_cursor_to_coords</strong></a>(self, (maxcol, maxrow), col, row)</dt><dd><tt>Pass to self.<strong>body</strong>.</tt></dd></dl><dl><dt><a name="Filler-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl><dl><dt><a name="Filler-selectable"><strong>selectable</strong></a>(self)</dt><dd><tt>Return selectable from body.</tt></dd></dl><dl><dt><a name="Filler-set_body"><strong>set_body</strong></a>(self, body)</dt></dl><hr>Data descriptors defined here:<br><dl><dt><strong>body</strong></dt></dl><hr>Data descriptors inherited from Widget:<br><dl><dt><strong>__dict__</strong></dt><dd><tt>dictionary for instance variables (if defined)</tt></dd></dl><dl><dt><strong>__weakref__</strong></dt><dd><tt>list of weak references to the object (if defined)</tt></dd></dl><hr>Data and other attributes inherited from Widget:<br><dl><dt><strong>__metaclass__</strong> = <class 'urwid.widget.WidgetMeta'><dd><tt>Automatic caching of render and rows methods.<br> <br>Class variable no_cache is a list of names of methods to not cache.<br>Class variable ignore_focus if defined and True indicates that this<br>widget is not affected by the focus parameter, so it may be ignored<br>when caching.</tt></dl><a name="ListBox"></a><h3>function ListBox <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="ListBox">class <strong>ListBox</strong></a>(BoxWidget) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt><dd>ListBox</dd><dd>BoxWidget</dd><dd>Widget</dd><dd>object</dd></dl><hr>Methods defined here:<br><dl><dt><a name="ListBox-__init__"><strong>__init__</strong></a>(self, body)</dt><dd><tt>body -- a ListWalker-like object that contains<br> widgets to be displayed inside the list box</tt></dd></dl><dl><dt><a name="ListBox-calculate_visible"><strong>calculate_visible</strong></a>(self, (maxcol, maxrow), focus<font color="#909090">=False</font>)</dt><dd><tt>Return (middle,top,bottom) or None,None,None.<br> <br>middle -- ( row offset(when +ve) or inset(when -ve),<br> focus widget, focus position, focus rows, <br> cursor coords or None )<br>top -- ( # lines to trim off top, <br> list of (widget, position, rows) tuples above focus<br> in order from bottom to top )<br>bottom -- ( # lines to trim off bottom, <br> list of (widget, position, rows) tuples below focus<br> in order from top to bottom )</tt></dd></dl><dl><dt><a name="ListBox-change_focus"><strong>change_focus</strong></a>(self, (maxcol, maxrow), position, offset_inset<font color="#909090">=0</font>, coming_from<font color="#909090">=None</font>, cursor_coords<font color="#909090">=None</font>, snap_rows<font color="#909090">=None</font>)</dt><dd><tt>Change the current focus widget.<br> <br>position -- a position compatible with self.<strong>body</strong>.set_focus<br>offset_inset_rows -- either the number of rows between the <br> top of the listbox and the start of the focus widget (+ve<br> value) or the number of lines of the focus widget hidden off <br> the top edge of the listbox (-ve value) or 0 if the top edge<br> of the focus widget is aligned with the top edge of the<br> listbox (default if unspecified)<br>coming_from -- eiter 'above', 'below' or unspecified (None)<br>cursor_coords -- (x, y) tuple indicating the desired<br> column and row for the cursor, a (x,) tuple indicating only<br> the column for the cursor, or unspecified (None)<br>snap_rows -- the maximum number of extra rows to scroll<br> when trying to "snap" a selectable focus into the view</tt></dd></dl>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -