⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reference.html

📁 Urwid is a Python library for making text console applications. It has many features including fluid
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<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&nbsp;a&nbsp;list&nbsp;that&nbsp;may&nbsp;contain&nbsp;'top'&nbsp;and/or&nbsp;'bottom'.<br>&nbsp;<br>convenience&nbsp;function&nbsp;for&nbsp;checking&nbsp;whether&nbsp;the&nbsp;top&nbsp;and&nbsp;bottom<br>of&nbsp;the&nbsp;list&nbsp;are&nbsp;visible</tt></dd></dl><dl><dt><a name="ListBox-get_focus"><strong>get_focus</strong></a>(self)</dt><dd><tt>Return&nbsp;a&nbsp;(focus&nbsp;widget,&nbsp;focus&nbsp;position)&nbsp;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&nbsp;(offset&nbsp;rows,&nbsp;inset&nbsp;rows)&nbsp;for&nbsp;focus&nbsp;widget.</tt></dd></dl><dl><dt><a name="ListBox-keypress"><strong>keypress</strong></a>(self, (maxcol, maxrow), key)</dt><dd><tt>Move&nbsp;selection&nbsp;through&nbsp;the&nbsp;list&nbsp;elements&nbsp;scrolling&nbsp;when&nbsp;<br>necessary.&nbsp;'up'&nbsp;and&nbsp;'down'&nbsp;are&nbsp;first&nbsp;passed&nbsp;to&nbsp;widget&nbsp;in&nbsp;focus<br>in&nbsp;case&nbsp;that&nbsp;widget&nbsp;can&nbsp;handle&nbsp;them.&nbsp;'page&nbsp;up'&nbsp;and&nbsp;'page&nbsp;down'<br>are&nbsp;always&nbsp;handled&nbsp;by&nbsp;the&nbsp;ListBox.<br>&nbsp;<br>Keystrokes&nbsp;handled&nbsp;by&nbsp;this&nbsp;widget&nbsp;are:<br>&nbsp;'up'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;up&nbsp;one&nbsp;line&nbsp;(or&nbsp;widget)<br>&nbsp;'down'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;down&nbsp;one&nbsp;line&nbsp;(or&nbsp;widget)<br>&nbsp;'page&nbsp;up'&nbsp;&nbsp;&nbsp;move&nbsp;cursor&nbsp;up&nbsp;one&nbsp;listbox&nbsp;length<br>&nbsp;'page&nbsp;down'&nbsp;move&nbsp;cursor&nbsp;down&nbsp;one&nbsp;listbox&nbsp;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&nbsp;the&nbsp;focus&nbsp;widget&nbsp;so&nbsp;that&nbsp;its&nbsp;cursor&nbsp;is&nbsp;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&nbsp;the&nbsp;event&nbsp;to&nbsp;the&nbsp;contained&nbsp;widgets.<br>May&nbsp;change&nbsp;focus&nbsp;on&nbsp;button&nbsp;1&nbsp;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&nbsp;the&nbsp;focus&nbsp;position&nbsp;and&nbsp;try&nbsp;to&nbsp;keep&nbsp;the&nbsp;old&nbsp;focus&nbsp;in&nbsp;view.<br>&nbsp;<br>position&nbsp;--&nbsp;a&nbsp;position&nbsp;compatible&nbsp;with&nbsp;self.<strong>body</strong>.set_focus<br>coming_from&nbsp;--&nbsp;set&nbsp;to&nbsp;'above'&nbsp;or&nbsp;'below'&nbsp;if&nbsp;you&nbsp;know&nbsp;that<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;old&nbsp;position&nbsp;is&nbsp;above&nbsp;or&nbsp;below&nbsp;the&nbsp;new&nbsp;position.</tt></dd></dl><dl><dt><a name="ListBox-set_focus_valign"><strong>set_focus_valign</strong></a>(self, valign)</dt><dd><tt>Set&nbsp;the&nbsp;focus&nbsp;widget's&nbsp;display&nbsp;offset&nbsp;and&nbsp;inset.<br>&nbsp;<br>valign&nbsp;--&nbsp;one&nbsp;of:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'top',&nbsp;'middle',&nbsp;'bottom'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;('fixed&nbsp;top',&nbsp;rows)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;('fixed&nbsp;bottom',&nbsp;rows)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;('relative',&nbsp;percentage&nbsp;0=top&nbsp;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&nbsp;the&nbsp;location&nbsp;of&nbsp;the&nbsp;current&nbsp;focus&nbsp;relative&nbsp;to&nbsp;the&nbsp;top.<br>&nbsp;<br>offset_inset&nbsp;--&nbsp;either&nbsp;the&nbsp;number&nbsp;of&nbsp;rows&nbsp;between&nbsp;the&nbsp;<br>&nbsp;&nbsp;top&nbsp;of&nbsp;the&nbsp;listbox&nbsp;and&nbsp;the&nbsp;start&nbsp;of&nbsp;the&nbsp;focus&nbsp;widget&nbsp;(+ve<br>&nbsp;&nbsp;value)&nbsp;or&nbsp;the&nbsp;number&nbsp;of&nbsp;lines&nbsp;of&nbsp;the&nbsp;focus&nbsp;widget&nbsp;hidden&nbsp;off&nbsp;<br>&nbsp;&nbsp;the&nbsp;top&nbsp;edge&nbsp;of&nbsp;the&nbsp;listbox&nbsp;(-ve&nbsp;value)&nbsp;or&nbsp;0&nbsp;if&nbsp;the&nbsp;top&nbsp;edge<br>&nbsp;&nbsp;of&nbsp;the&nbsp;focus&nbsp;widget&nbsp;is&nbsp;aligned&nbsp;with&nbsp;the&nbsp;top&nbsp;edge&nbsp;of&nbsp;the<br>&nbsp;&nbsp;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&nbsp;self.<strong>pref_col</strong>&nbsp;from&nbsp;the&nbsp;focus&nbsp;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&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd></dl><dl><dt><strong>__weakref__</strong></dt><dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd></dl><hr>Data and other attributes inherited from Widget:<br><dl><dt><strong>__metaclass__</strong> = &lt;class 'urwid.widget.WidgetMeta'&gt;<dd><tt>Automatic&nbsp;caching&nbsp;of&nbsp;render&nbsp;and&nbsp;rows&nbsp;methods.<br>&nbsp;<br>Class&nbsp;variable&nbsp;no_cache&nbsp;is&nbsp;a&nbsp;list&nbsp;of&nbsp;names&nbsp;of&nbsp;methods&nbsp;to&nbsp;not&nbsp;cache.<br>Class&nbsp;variable&nbsp;ignore_focus&nbsp;if&nbsp;defined&nbsp;and&nbsp;True&nbsp;indicates&nbsp;that&nbsp;this<br>widget&nbsp;is&nbsp;not&nbsp;affected&nbsp;by&nbsp;the&nbsp;focus&nbsp;parameter,&nbsp;so&nbsp;it&nbsp;may&nbsp;be&nbsp;ignored<br>when&nbsp;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&nbsp;self.<strong>w</strong>&nbsp;if&nbsp;name&nbsp;is&nbsp;in&nbsp;Widget&nbsp;interface&nbsp;definition.</tt></dd></dl><dl><dt><a name="WidgetWrap-__init__"><strong>__init__</strong></a>(self, w)</dt><dd><tt>w&nbsp;--&nbsp;widget&nbsp;to&nbsp;wrap,&nbsp;stored&nbsp;as&nbsp;self.<strong>w</strong><br>&nbsp;<br>This&nbsp;object&nbsp;will&nbsp;pass&nbsp;the&nbsp;functions&nbsp;defined&nbsp;in&nbsp;Widget&nbsp;interface<br>definition&nbsp;to&nbsp;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&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd></dl><dl><dt><strong>__weakref__</strong></dt><dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd></dl><hr>Data and other attributes inherited from Widget:<br><dl><dt><strong>__metaclass__</strong> = &lt;class 'urwid.widget.WidgetMeta'&gt;<dd><tt>Automatic&nbsp;caching&nbsp;of&nbsp;render&nbsp;and&nbsp;rows&nbsp;methods.<br>&nbsp;<br>Class&nbsp;variable&nbsp;no_cache&nbsp;is&nbsp;a&nbsp;list&nbsp;of&nbsp;names&nbsp;of&nbsp;methods&nbsp;to&nbsp;not&nbsp;cache.<br>Class&nbsp;variable&nbsp;ignore_focus&nbsp;if&nbsp;defined&nbsp;and&nbsp;True&nbsp;indicates&nbsp;that&nbsp;this<br>widget&nbsp;is&nbsp;not&nbsp;affected&nbsp;by&nbsp;the&nbsp;focus&nbsp;parameter,&nbsp;so&nbsp;it&nbsp;may&nbsp;be&nbsp;ignored<br>when&nbsp;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&nbsp;getattr&nbsp;on&nbsp;wrapped&nbsp;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&nbsp;--&nbsp;widget&nbsp;to&nbsp;wrap<br>attr&nbsp;--&nbsp;attribute&nbsp;to&nbsp;apply&nbsp;to&nbsp;w<br>focus_attr&nbsp;--&nbsp;attribute&nbsp;to&nbsp;apply&nbsp;when&nbsp;in&nbsp;focus,&nbsp;if&nbsp;None&nbsp;use&nbsp;attr<br>&nbsp;<br>This&nbsp;object&nbsp;will&nbsp;pass&nbsp;all&nbsp;function&nbsp;calls&nbsp;and&nbsp;variable&nbsp;references<br>to&nbsp;the&nbsp;wrapped&nbsp;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&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd></dl><dl><dt><strong>__weakref__</strong></dt><dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd></dl><hr>Data and other attributes inherited from Widget:<br><dl><dt><strong>__metaclass__</strong> = &lt;class 'urwid.widget.WidgetMeta'&gt;<dd><tt>Automatic&nbsp;caching&nbsp;of&nbsp;render&nbsp;and&nbsp;rows&nbsp;methods.<br>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -