📄 reference.html
字号:
<dl><dt><strong>__weakref__</strong></dt><dd><tt>list of weak references to the object (if defined)</tt></dd></dl><a name="curses_display.Screen"></a><h3>function curses_display.Screen <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="curses_display.Screen"></a><strong>curses_display.Screen</strong> <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3>Methods defined here:<br><dl><dt><a name="Screen-__init__"><strong>__init__</strong></a>(self)</dt></dl><dl><dt><a name="Screen-clear"><strong>clear</strong></a>(self)</dt><dd><tt>Force the screen to be completely repainted on the next<br>call to draw_screen().</tt></dd></dl><dl><dt><a name="Screen-draw_screen"><strong>draw_screen</strong></a>(self, (cols, rows), r)</dt><dd><tt>Paint screen with rendered canvas.</tt></dd></dl><dl><dt><a name="Screen-get_cols_rows"><strong>get_cols_rows</strong></a>(self)</dt><dd><tt>Return the terminal dimensions (num columns, num rows).</tt></dd></dl><dl><dt><a name="Screen-get_input"><strong>get_input</strong></a>(self, raw_keys<font color="#909090">=False</font>)</dt><dd><tt>Return pending input as a list.<br> <br>raw_keys -- return raw keycodes as well as translated versions<br> <br>This function will immediately return all the input since the<br>last time it was called. If there is no input pending it will<br>wait before returning an empty list. The wait time may be<br>configured with the set_input_timeouts function.<br> <br>If raw_keys is False (default) this function will return a list<br>of keys pressed. If raw_keys is True this function will return<br>a ( keys pressed, raw keycodes ) tuple instead.<br> <br>Examples of keys returned<br>-------------------------<br>ASCII printable characters: " ", "a", "0", "A", "-", "/" <br>ASCII control characters: "tab", "enter"<br>Escape sequences: "up", "page up", "home", "insert", "f1"<br>Key combinations: "shift f1", "meta a", "ctrl b"<br>Window events: "window resize"<br> <br>When a narrow encoding is not enabled<br>"Extended ASCII" characters: "\xa1", "\xb2", "\xfe"<br> <br>When a wide encoding is enabled<br>Double-byte characters: "\xa1\xea", "\xb2\xd4"<br> <br>When utf8 encoding is enabled<br>Unicode characters: u"\u00a5", u'\u253c"<br> <br>Examples of mouse events returned<br>---------------------------------<br>Mouse button press: ('mouse press', 1, 15, 13), <br> ('meta mouse press', 2, 17, 23)<br>Mouse button release: ('mouse release', 0, 18, 13),<br> ('ctrl mouse release', 0, 17, 23)</tt></dd></dl><dl><dt><a name="Screen-register_palette"><strong>register_palette</strong></a>(self, l)</dt><dd><tt>Register a list of palette entries.<br> <br>l -- list of (name, foreground, background, mono),<br> (name, foreground, background) or<br> (name, same_as_other_name) palette entries.<br> <br>calls self.<strong>register_palette_entry</strong> for each item in l</tt></dd></dl><dl><dt><a name="Screen-register_palette_entry"><strong>register_palette_entry</strong></a>(self, name, foreground, background, mono<font color="#909090">=None</font>)</dt><dd><tt>Register a single palette entry.<br> <br>name -- new entry/attribute name<br>foreground -- foreground colour, one of: 'black', 'dark red',<br> 'dark green', 'brown', 'dark blue', 'dark magenta',<br> 'dark cyan', 'light gray', 'dark gray', 'light red',<br> 'light green', 'yellow', 'light blue', 'light magenta',<br> 'light cyan', 'white', 'default' (black if unable to<br> use terminal's default)<br>background -- background colour, one of: 'black', 'dark red',<br> 'dark green', 'brown', 'dark blue', 'dark magenta',<br> 'dark cyan', 'light gray', 'default' (light gray if<br> unable to use terminal's default)<br>mono -- monochrome terminal attribute, one of: None (default),<br> 'bold', 'underline', 'standout', or a tuple containing<br> a combination eg. ('bold','underline')</tt></dd></dl><dl><dt><a name="Screen-run_wrapper"><strong>run_wrapper</strong></a>(self, fn)</dt><dd><tt>Call fn in fullscreen mode. Return to normal on exit.<br> <br>This function should be called to wrap your main program loop.<br>Exception tracebacks will be displayed in normal mode.</tt></dd></dl><dl><dt><a name="Screen-set_input_timeouts"><strong>set_input_timeouts</strong></a>(self, max_wait<font color="#909090">=0.5</font>, complete_wait<font color="#909090">=0.10000000000000001</font>, resize_wait<font color="#909090">=0.10000000000000001</font>)</dt><dd><tt>Set the get_input timeout values. All values have a granularity<br>of 0.1s, ie. any value between 0.15 and 0.05 will be treated as<br>0.1 and any value less than 0.05 will be treated as 0. <br> <br>max_wait -- amount of time in seconds to wait for input when<br> there is no input pending<br>complete_wait -- amount of time in seconds to wait when<br> get_input detects an incomplete escape sequence at the<br> end of the available input<br>resize_wait -- amount of time in seconds to wait for more input<br> after receiving two screen resize requests in a row to<br> stop urwid from consuming 100% cpu during a gradual<br> window resize operation</tt></dd></dl><dl><dt><a name="Screen-set_mouse_tracking"><strong>set_mouse_tracking</strong></a>(self)</dt><dd><tt>Enable mouse tracking. <br> <br>After calling this function get_input will include mouse<br>click events along with keystrokes.</tt></dd></dl><dl><dt><a name="Screen-start"><strong>start</strong></a>(self)</dt><dd><tt>Initialize the screen and input mode.</tt></dd></dl><dl><dt><a name="Screen-stop"><strong>stop</strong></a>(self)</dt><dd><tt>Restore the screen.</tt></dd></dl><hr>Data descriptors defined here:<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><h3><a name="web_display.Screen"></a><strong>web_display.Screen</strong> <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3>Methods defined here:<br><dl><dt><a name="Screen-__init__"><strong>__init__</strong></a>(self)</dt></dl><dl><dt><a name="Screen-clear"><strong>clear</strong></a>(self)</dt><dd><tt>Force the screen to be completely repainted on the next<br>call to draw_screen().<br> <br>(does nothing for web_display)</tt></dd></dl><dl><dt><a name="Screen-draw_screen"><strong>draw_screen</strong></a>(self, (cols, rows), r)</dt><dd><tt>Send a screen update to the client.</tt></dd></dl><dl><dt><a name="Screen-get_cols_rows"><strong>get_cols_rows</strong></a>(self)</dt><dd><tt>Return the screen size.</tt></dd></dl><dl><dt><a name="Screen-get_input"><strong>get_input</strong></a>(self, raw_keys<font color="#909090">=False</font>)</dt><dd><tt>Return pending input as a list.</tt></dd></dl><dl><dt><a name="Screen-register_palette"><strong>register_palette</strong></a>(self, l)</dt><dd><tt>Register a list of palette entries.<br> <br>l -- list of (name, foreground, background) or<br> (name, same_as_other_name) palette entries.<br> <br>calls self.<strong>register_palette_entry</strong> for each item in l</tt></dd></dl><dl><dt><a name="Screen-register_palette_entry"><strong>register_palette_entry</strong></a>(self, name, foreground, background, mono<font color="#909090">=None</font>)</dt><dd><tt>Register a single palette entry.<br> <br>name -- new entry/attribute name<br>foreground -- foreground colour<br>background -- background colour<br>mono -- monochrome terminal attribute<br> <br>See curses_display.register_palette_entry for more info.</tt></dd></dl><dl><dt><a name="Screen-run_wrapper"><strong>run_wrapper</strong></a>(self, fn)</dt><dd><tt>Run the application main loop, calling start() first<br>and stop() on exit.</tt></dd></dl><dl><dt><a name="Screen-set_mouse_tracking"><strong>set_mouse_tracking</strong></a>(self)</dt><dd><tt>Not yet implemented</tt></dd></dl><dl><dt><a name="Screen-start"><strong>start</strong></a>(self)</dt><dd><tt>This function reads the initial screen size, generates a<br>unique id and handles cleanup when fn exits.<br> <br>web_display.set_preferences(..) must be called before calling<br>this function for the preferences to take effect</tt></dd></dl><dl><dt><a name="Screen-stop"><strong>stop</strong></a>(self)</dt><dd><tt>Restore settings and clean up.</tt></dd></dl><h2>Top-level widgets</h2><a name="Frame"></a><h3>function Frame <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="Frame">class <strong>Frame</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>Frame</dd><dd>BoxWidget</dd><dd>Widget</dd><dd>object</dd></dl><hr>Methods defined here:<br><dl><dt><a name="Frame-__init__"><strong>__init__</strong></a>(self, body, header<font color="#909090">=None</font>, footer<font color="#909090">=None</font>, focus_part<font color="#909090">='body'</font>)</dt><dd><tt>body -- a box widget for the body of the frame<br>header -- a flow widget for above the body (or None)<br>footer -- a flow widget for below the body (or None)<br>focus_part -- 'header', 'footer' or 'body'</tt></dd></dl><dl><dt><a name="Frame-frame_top_bottom"><strong>frame_top_bottom</strong></a>(self, (maxcol, maxrow), focus)</dt><dd><tt>Calculate the number of rows for the header and footer.<br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -