📄 reference.html
字号:
<dl><dt><a name="ListBox-ends_visible"><strong>ends_visible</strong></a>(self, (maxcol, maxrow), focus<font color="#909090">=False</font>)</dt><dd><tt>Return a list that may contain 'top' and/or 'bottom'.<br> <br>convenience function for checking whether the top and bottom<br>of the list are visible</tt></dd></dl><dl><dt><a name="ListBox-get_focus"><strong>get_focus</strong></a>(self)</dt><dd><tt>Return a (focus widget, focus position) tuple.</tt></dd></dl><dl><dt><a name="ListBox-get_focus_offset_inset"><strong>get_focus_offset_inset</strong></a>(self, (maxcol, maxrow))</dt><dd><tt>Return (offset rows, inset rows) for focus widget.</tt></dd></dl><dl><dt><a name="ListBox-keypress"><strong>keypress</strong></a>(self, (maxcol, maxrow), key)</dt><dd><tt>Move selection through the list elements scrolling when <br>necessary. 'up' and 'down' are first passed to widget in focus<br>in case that widget can handle them. 'page up' and 'page down'<br>are always handled by the ListBox.<br> <br>Keystrokes handled by this widget are:<br> 'up' up one line (or widget)<br> 'down' down one line (or widget)<br> 'page up' move cursor up one listbox length<br> 'page down' move cursor down one listbox length</tt></dd></dl><dl><dt><a name="ListBox-make_cursor_visible"><strong>make_cursor_visible</strong></a>(self, (maxcol, maxrow))</dt><dd><tt>Shift the focus widget so that its cursor is visible.</tt></dd></dl><dl><dt><a name="ListBox-mouse_event"><strong>mouse_event</strong></a>(self, (maxcol, maxrow), event, button, col, row, focus)</dt><dd><tt>Pass the event to the contained widgets.<br>May change focus on button 1 press.</tt></dd></dl><dl><dt><a name="ListBox-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl><dl><dt><a name="ListBox-set_focus"><strong>set_focus</strong></a>(self, position, coming_from<font color="#909090">=None</font>)</dt><dd><tt>Set the focus position and try to keep the old focus in view.<br> <br>position -- a position compatible with self.<strong>body</strong>.set_focus<br>coming_from -- set to 'above' or 'below' if you know that<br> old position is above or below the new position.</tt></dd></dl><dl><dt><a name="ListBox-set_focus_valign"><strong>set_focus_valign</strong></a>(self, valign)</dt><dd><tt>Set the focus widget's display offset and inset.<br> <br>valign -- one of:<br> 'top', 'middle', 'bottom'<br> ('fixed top', rows)<br> ('fixed bottom', rows)<br> ('relative', percentage 0=top 100=bottom)</tt></dd></dl><dl><dt><a name="ListBox-shift_focus"><strong>shift_focus</strong></a>(self, (maxcol, maxrow), offset_inset)</dt><dd><tt>Move the location of the current focus relative to the top.<br> <br>offset_inset -- 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</tt></dd></dl><dl><dt><a name="ListBox-update_pref_col_from_focus"><strong>update_pref_col_from_focus</strong></a>(self, (maxcol, maxrow))</dt><dd><tt>Update self.<strong>pref_col</strong> from the focus widget.</tt></dd></dl><hr>Methods inherited from Widget:<br><dl><dt><a name="ListBox-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><h2>Decorations</h2><a name="WidgetWrap"></a><h3>function WidgetWrap <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="WidgetWrap">class <strong>WidgetWrap</strong></a>(Widget) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt><dd>WidgetWrap</dd><dd>Widget</dd><dd>object</dd></dl><hr>Methods defined here:<br><dl><dt><a name="WidgetWrap-__getattr__"><strong>__getattr__</strong></a>(self, name)</dt><dd><tt>Call self.<strong>w</strong> if name is in Widget interface definition.</tt></dd></dl><dl><dt><a name="WidgetWrap-__init__"><strong>__init__</strong></a>(self, w)</dt><dd><tt>w -- widget to wrap, stored as self.<strong>w</strong><br> <br>This object will pass the functions defined in Widget interface<br>definition to self.<strong>w</strong>.</tt></dd></dl><dl><dt><a name="WidgetWrap-get_w"><strong>get_w</strong></a>(self)</dt></dl><dl><dt><a name="WidgetWrap-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl><dl><dt><a name="WidgetWrap-selectable"><strong>selectable</strong></a>(self)</dt></dl><dl><dt><a name="WidgetWrap-set_w"><strong>set_w</strong></a>(self, w)</dt></dl><hr>Data descriptors defined here:<br><dl><dt><strong>w</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="AttrWrap"></a><h3>function AttrWrap <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="AttrWrap">class <strong>AttrWrap</strong></a>(Widget) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt><dd>AttrWrap</dd><dd>Widget</dd><dd>object</dd></dl><hr>Methods defined here:<br><dl><dt><a name="AttrWrap-__getattr__"><strong>__getattr__</strong></a>(self, name)</dt><dd><tt>Call getattr on wrapped widget.</tt></dd></dl><dl><dt><a name="AttrWrap-__init__"><strong>__init__</strong></a>(self, w, attr, focus_attr<font color="#909090">=None</font>)</dt><dd><tt>w -- widget to wrap<br>attr -- attribute to apply to w<br>focus_attr -- attribute to apply when in focus, if None use attr<br> <br>This object will pass all function calls and variable references<br>to the wrapped widget.</tt></dd></dl><dl><dt><a name="AttrWrap-get_attr"><strong>get_attr</strong></a>(self)</dt></dl><dl><dt><a name="AttrWrap-get_focus_attr"><strong>get_focus_attr</strong></a>(self)</dt></dl><dl><dt><a name="AttrWrap-get_w"><strong>get_w</strong></a>(self)</dt></dl><dl><dt><a name="AttrWrap-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl><dl><dt><a name="AttrWrap-selectable"><strong>selectable</strong></a>(self)</dt></dl><dl><dt><a name="AttrWrap-set_attr"><strong>set_attr</strong></a>(self, attr)</dt></dl><dl><dt><a name="AttrWrap-set_focus_attr"><strong>set_focus_attr</strong></a>(self, focus_attr)</dt></dl><dl><dt><a name="AttrWrap-set_w"><strong>set_w</strong></a>(self, w)</dt></dl><hr>Data descriptors defined here:<br><dl><dt><strong>attr</strong></dt></dl><dl><dt><strong>focus_attr</strong></dt></dl><dl><dt><strong>w</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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -