<html> <head> <title>Urwid 0.9.8.4 Reference</title> <style type="text/css"> h1 { text-align: center; } h2 { margin: 40px 0 0 0; padding: 10px; background: #6d96e8;} h3 { margin: 0 0 3px 0; padding: 12px 6px 6px 6px; background: #efef96;} .l1 { margin: 12px 0 0 0; } .l2 { margin-left: 20px; } </style> <body> <a name="top"></a> <h1>Urwid 0.9.8.4 Reference</h1> <div style="text-align: center;"> <a href="http://excess.org/urwid/">Urwid Home Page</a> / <a href="http://excess.org/urwid/examples.html">Example Screenshots</a> / <a href="http://excess.org/urwid/utf8examples.html">UTF-8 Screenshots</a> / <a href="tutorial.html">Tutorial</a> / Reference </div> <br> <table width="100%"><tr><td width="33%" valign="top"><div class="l1">User interface wrappers</div><div class="l2"><a href="#raw_display.Screen">raw_display.Screen</a> </div><div class="l2"><a href="#curses_display.Screen">curses_display.Screen</a> </div><div class="l2"><a href="#web_display.Screen">web_display.Screen</a> </div><div class="l1">Top-level widgets</div><div class="l2"><a href="#Frame">Frame</a> [<b>B</b>]</div><div class="l2"><a href="#Filler">Filler</a> [<b>B</b>]</div><div class="l2"><a href="#ListBox">ListBox</a> [<b>B</b>]</div><div class="l1">Decorations</div><div class="l2"><a href="#WidgetWrap">WidgetWrap</a> [<b>F</b>/<b>B</b>]</div><div class="l2"><a href="#AttrWrap">AttrWrap</a> [<b>F</b>/<b>B</b>]</div><div class="l2"><a href="#Padding">Padding</a> [<b>F</b>/<b>B</b>]</div><div class="l2"><a href="#Divider">Divider</a> [<b>F</b>]</div><div class="l2"><a href="#LineBox">LineBox</a> [<b>F</b>/<b>B</b>]</div><div class="l2"><a href="#SolidFill">SolidFill</a> [<b>B</b>]</div><div class="l1">Composite widgets</div><div class="l2"><a href="#Columns">Columns</a> [<b>F</b>/<b>B</b>]</div><div class="l2"><a href="#Pile">Pile</a> [<b>F</b>/<b>B</b>]</div><div class="l2"><a href="#GridFlow">GridFlow</a> [<b>F</b>]</div><div class="l2"><a href="#BoxAdapter">BoxAdapter</a> [<b>F</b>]</div><div class="l2"><a href="#Overlay">Overlay</a> [<b>B</b>]</div></td><td width="33%" valign="top"><div class="l1">Content widgets</div><div class="l2"><a href="#Text">Text</a> [<b>F</b>]</div><div class="l2"><a href="#Edit">Edit</a> [<b>F</b>]</div><div class="l2"><a href="#IntEdit">IntEdit</a> [<b>F</b>]</div><div class="l2"><a href="#Button">Button</a> [<b>F</b>]</div><div class="l2"><a href="#CheckBox">CheckBox</a> [<b>F</b>]</div><div class="l2"><a href="#RadioButton">RadioButton</a> [<b>F</b>]</div><div class="l1">Graphics</div><div class="l2"><a href="#BarGraph">BarGraph</a> [<b>B</b>]</div><div class="l2"><a href="#GraphVScale">GraphVScale</a> [<b>B</b>]</div><div class="l2"><a href="#ProgressBar">ProgressBar</a> [<b>F</b>]</div><div class="l2"><a href="#BigText">BigText</a> [<b>X</b>]</div><div class="l2"><a href="#get_all_fonts">get_all_fonts</a> </div><div class="l1">Abstract widgets & interfaces</div><div class="l2"><a href="#Widget_interface_definition">Widget interface definition</a> </div><div class="l2"><a href="#Widget">Widget</a> </div><div class="l2"><a href="#BoxWidget">BoxWidget</a> </div><div class="l2"><a href="#FlowWidget">FlowWidget</a> </div><div class="l2"><a href="#FixedWidget">FixedWidget</a> </div><div class="l2"><a href="#List_Walker_interface_definition">List Walker interface definition</a> </div><div class="l2"><a href="#ListWalker">ListWalker</a> </div><div class="l1">ListBox list walkers</div><div class="l2"><a href="#PollingListWalker">PollingListWalker</a> </div><div class="l2"><a href="#SimpleListWalker">SimpleListWalker</a> </div></td><td width="33%" valign="top"><div class="l1">Canvas painting</div><div class="l2"><a href="#Canvas">Canvas</a> </div><div class="l2"><a href="#TextCanvas">TextCanvas</a> </div><div class="l2"><a href="#CompositeCanvas">CompositeCanvas</a> </div><div class="l2"><a href="#SolidCanvas">SolidCanvas</a> </div><div class="l2"><a href="#CanvasCombine">CanvasCombine</a> </div><div class="l2"><a href="#CanvasJoin">CanvasJoin</a> </div><div class="l2"><a href="#CanvasOverlay">CanvasOverlay</a> </div><div class="l1">Custom formatting rules</div><div class="l2"><a href="#TextLayout">TextLayout</a> </div><div class="l2"><a href="#StandardTextLayout">StandardTextLayout</a> </div><div class="l1">Character encoding</div><div class="l2"><a href="#set_encoding">set_encoding</a> </div><div class="l2"><a href="#get_encoding_mode">get_encoding_mode</a> </div><div class="l2"><a href="#supports_unicode">supports_unicode</a> </div><div class="l1">Screen capture</div><div class="l2"><a href="#html_fragment.screenshot_init">html_fragment.screenshot_init</a> </div><div class="l2"><a href="#html_fragment.screenshot_collect">html_fragment.screenshot_collect</a> </div><div class="l2"><a href="#html_fragment.HtmlGenerator">html_fragment.HtmlGenerator</a> </div><div class="l1">Web Application Interface</div><div class="l2"><a href="#web_display.is_web_request">web_display.is_web_request</a> </div><div class="l2"><a href="#web_display.set_preferences">web_display.set_preferences</a> </div><div class="l2"><a href="#web_display.handle_short_request">web_display.handle_short_request</a> </div></td></tr></table> <br> [<b>F</b>] = Flow Widget displayed with assigned screen columns and variable screen rows<br> [<b>B</b>] = Box Widget displayed with assigned screen columns and assigned screen rows<br> [<b>F</b>/<b>B</b>] = May behave as either Flow Widget or Box Widget<br> [<b>X</b>] = Fixed Widget has a fixed number of screen columns and rows <br> <h2>User interface wrappers</h2><a name="raw_display.Screen"></a><h3>function raw_display.Screen <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="raw_display.Screen"></a><strong>raw_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, (maxcol, maxrow), 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 drag: ('mouse drag', 1, 16, 13),<br> ('mouse drag', 1, 17, 13),<br> ('ctrl mouse drag', 1, 18, 13)<br> Mouse button release: ('mouse release', 0, 18, 13),<br> ('ctrl mouse release', 0, 17, 23)</tt></dd></dl> <dl><dt><a name="Screen-get_input_descriptors"><strong>get_input_descriptors</strong></a>(self)</dt><dd><tt>Return a list of integer file descriptors that should be<br> polled in external event loops to check for user input.<br> <br> Use this method if you are implementing yout own event loop.</tt></dd></dl> <dl><dt><a name="Screen-get_input_nonblocking"><strong>get_input_nonblocking</strong></a>(self)</dt><dd><tt>Return a (next_input_timeout, keys_pressed, raw_keycodes) <br> tuple.<br> <br> Use this method if you are implementing your own event loop.<br> <br> When there is input waiting on one of the descriptors returned<br> by get_input_descriptors() this method should be called to<br> read and process the input.<br> <br> This method expects to be called in next_input_timeout seconds<br> (a floating point number) if there is no input waiting.</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, alternate_buffer<font color="#909090">=True</font>)</dt><dd><tt>Call start to initialize screen, then call fn. <br> When fn exits call stop to restore the screen to normal.<br> <br> alternate_buffer -- use alternate screen buffer and restore<br> normal screen buffer on exit</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 are floating<br> point number of seconds.<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-signal_init"><strong>signal_init</strong></a>(self)</dt><dd><tt>Called in the startup of run wrapper to set the SIGWINCH <br> signal handler to self.<strong>_sigwinch_handler</strong>.<br> <br> Override this function to call from main thread in threaded<br> applications.</tt></dd></dl> <dl><dt><a name="Screen-signal_restore"><strong>signal_restore</strong></a>(self)</dt><dd><tt>Called in the finally block of run wrapper to restore the<br> SIGWINCH handler to the default handler.<br> <br> Override this function to call from main thread in threaded<br> applications.</tt></dd></dl> <dl><dt><a name="Screen-start"><strong>start</strong></a>(self, alternate_buffer<font color="#909090">=True</font>)</dt><dd><tt>Initialize the screen and input mode.<br> <br> alternate_buffer -- use alternate screen buffer</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> <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> <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> <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> <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="Padding"></a><h3>function Padding <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="Padding">class <strong>Padding</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>Padding</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="Padding-__init__"><strong>__init__</strong></a>(self, w, align, width, min_width<font color="#909090">=None</font>)</dt><dd><tt>w -- a box, flow or fixed widget to pad on the left and/or right<br> align -- one of:<br> 'left', 'center', 'right'<br> ('fixed left', columns)<br> ('fixed right', columns)<br> ('relative', percentage 0=left 100=right)<br> width -- one of:<br> number of columns wide <br> ('fixed right', columns) Only if align is 'fixed left'<br> ('fixed left', columns) Only if align is 'fixed right'<br> ('relative', percentage of total width)<br> None to enable clipping mode<br> min_width -- the minimum number of columns for w or None<br> <br> Padding widgets will try to satisfy width argument first by<br> reducing the align amount when necessary. If width still <br> cannot be satisfied it will also be reduced.<br> <br> Clipping Mode:<br> In clipping mode w is treated as a fixed widget and this <br> widget expects to be treated as a flow widget. w will<br> be clipped to fit within the space given. For example,<br> if align is 'left' then w may be clipped on the right.</tt></dd></dl> <dl><dt><a name="Padding-get_cursor_coords"><strong>get_cursor_coords</strong></a>(self, size)</dt><dd><tt>Return the (x,y) coordinates of cursor within self.<strong>w</strong>.</tt></dd></dl> <dl><dt><a name="Padding-get_pref_col"><strong>get_pref_col</strong></a>(self, size)</dt><dd><tt>Return the preferred column from self.<strong>w</strong>, or None.</tt></dd></dl> <dl><dt><a name="Padding-keypress"><strong>keypress</strong></a>(self, size, key)</dt><dd><tt>Pass keypress to self.<strong>w</strong>.</tt></dd></dl> <dl><dt><a name="Padding-mouse_event"><strong>mouse_event</strong></a>(self, size, event, button, x, y, focus)</dt><dd><tt>Send mouse event if position is within self.<strong>w</strong>.</tt></dd></dl> <dl><dt><a name="Padding-move_cursor_to_coords"><strong>move_cursor_to_coords</strong></a>(self, size, x, y)</dt><dd><tt>Set the cursor position with (x,y) coordinates of self.<strong>w</strong>.<br> <br> Returns True if move succeeded, False otherwise.</tt></dd></dl> <dl><dt><a name="Padding-padding_values"><strong>padding_values</strong></a>(self, size, focus)</dt><dd><tt>Return the number of columns to pad on the left and right.<br> <br> Override this method to define custom padding behaviour.</tt></dd></dl> <dl><dt><a name="Padding-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="Padding-rows"><strong>rows</strong></a> = cached_rows(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="Padding-selectable"><strong>selectable</strong></a>(self)</dt><dd><tt>Return the selectable value of self.<strong>w</strong>.</tt></dd></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="Divider"></a><h3>function Divider <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="Divider">class <strong>Divider</strong></a>(FlowWidget) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt> <dd>Divider</dd> <dd>FlowWidget</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="Divider-__init__"><strong>__init__</strong></a>(self, div_char<font color="#909090">=' '</font>, top<font color="#909090">=0</font>, bottom<font color="#909090">=0</font>)</dt><dd><tt>div_char -- character to repeat across line<br> top -- number of blank lines above<br> bottom -- number of blank lines below</tt></dd></dl> <dl><dt><a name="Divider-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="Divider-rows"><strong>rows</strong></a> = cached_rows(self, size, focus<font color="#909090">=False</font>)</dt></dl> <hr> Methods inherited from Widget:<br> <dl><dt><a name="Divider-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="LineBox"></a><h3>function LineBox <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="LineBox">class <strong>LineBox</strong></a>(WidgetWrap) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt> <dd>LineBox</dd> <dd>WidgetWrap</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="LineBox-__init__"><strong>__init__</strong></a>(self, w)</dt><dd><tt>Draw a line around w.</tt></dd></dl> <hr> Methods inherited from WidgetWrap:<br> <dl><dt><a name="LineBox-__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="LineBox-get_w"><strong>get_w</strong></a>(self)</dt></dl> <dl><dt><a name="LineBox-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="LineBox-selectable"><strong>selectable</strong></a>(self)</dt></dl> <dl><dt><a name="LineBox-set_w"><strong>set_w</strong></a>(self, w)</dt></dl> <hr> Data descriptors inherited from WidgetWrap:<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="SolidFill"></a><h3>function SolidFill <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="SolidFill">class <strong>SolidFill</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>SolidFill</dd> <dd>BoxWidget</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="SolidFill-__init__"><strong>__init__</strong></a>(self, fill_char<font color="#909090">=' '</font>)</dt><dd><tt>fill_char -- character to fill area with</tt></dd></dl> <dl><dt><a name="SolidFill-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <hr> Methods inherited from Widget:<br> <dl><dt><a name="SolidFill-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>Composite widgets</h2><a name="Columns"></a><h3>function Columns <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="Columns">class <strong>Columns</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>Columns</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="Columns-__init__"><strong>__init__</strong></a>(self, widget_list, dividechars<font color="#909090">=0</font>, focus_column<font color="#909090">=None</font>, min_width<font color="#909090">=1</font>, box_columns<font color="#909090">=None</font>)</dt><dd><tt>widget_list -- list of flow widgets or list of box widgets<br> dividechars -- blank characters between columns<br> focus_column -- index into widget_list of column in focus,<br> if None the first selectable widget will be chosen.<br> min_width -- minimum width for each column before it is hidden<br> box_columns -- a list of column indexes containing box widgets<br> whose maxrow is set to the maximum of the rows <br> required by columns not listed in box_columns.<br> <br> widget_list may also contain tuples such as:<br> ('fixed', width, widget) give this column a fixed width<br> ('weight', weight, widget) give this column a relative weight<br> <br> widgets not in a tuple are the same as ('weight', 1, widget) <br> <br> box_columns is ignored when this widget is being used as a<br> box widget because in that case all columns are treated as box<br> widgets.</tt></dd></dl> <dl><dt><a name="Columns-column_widths"><strong>column_widths</strong></a>(self, size)</dt><dd><tt>Return a list of column widths.<br> <br> size -- (maxcol,) if self.<strong>widget_list</strong> contains flow widgets or<br> (maxcol, maxrow) if it contains box widgets.</tt></dd></dl> <dl><dt><a name="Columns-get_cursor_coords"><strong>get_cursor_coords</strong></a>(self, size)</dt><dd><tt>Return the cursor coordinates from the focus widget.</tt></dd></dl> <dl><dt><a name="Columns-get_focus"><strong>get_focus</strong></a>(self)</dt><dd><tt>Return the widget in focus.</tt></dd></dl> <dl><dt><a name="Columns-get_focus_column"><strong>get_focus_column</strong></a>(self)</dt><dd><tt>Return the focus column index.</tt></dd></dl> <dl><dt><a name="Columns-get_pref_col"><strong>get_pref_col</strong></a>(self, size)</dt><dd><tt>Return the pref col from the column in focus.</tt></dd></dl> <dl><dt><a name="Columns-keypress"><strong>keypress</strong></a>(self, size, key)</dt><dd><tt>Pass keypress to the focus column.<br> <br> size -- (maxcol,) if self.<strong>widget_list</strong> contains flow widgets or<br> (maxcol, maxrow) if it contains box widgets.</tt></dd></dl> <dl><dt><a name="Columns-mouse_event"><strong>mouse_event</strong></a>(self, size, event, button, col, row, focus)</dt><dd><tt>Send event to appropriate column.<br> May change focus on button 1 press.</tt></dd></dl> <dl><dt><a name="Columns-move_cursor_to_coords"><strong>move_cursor_to_coords</strong></a>(self, size, col, row)</dt><dd><tt>Choose a selectable column to focus based on the coords.</tt></dd></dl> <dl><dt><a name="Columns-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="Columns-rows"><strong>rows</strong></a> = cached_rows(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="Columns-selectable"><strong>selectable</strong></a>(self)</dt><dd><tt>Return the selectable value of the focus column.</tt></dd></dl> <dl><dt><a name="Columns-set_focus"><strong>set_focus</strong></a>(self, item)</dt><dd><tt>Set the item in focus. <br> <br> item -- widget or integer index</tt></dd></dl> <dl><dt><a name="Columns-set_focus_column"><strong>set_focus_column</strong></a>(self, num)</dt><dd><tt>Set the column in focus by its index in self.<strong>widget_list</strong>.</tt></dd></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="Pile"></a><h3>function Pile <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="Pile">class <strong>Pile</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>Pile</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="Pile-__init__"><strong>__init__</strong></a>(self, widget_list, focus_item<font color="#909090">=None</font>)</dt><dd><tt>widget_list -- list of widgets<br> focus_item -- widget or integer index, if None the first<br> selectable widget will be chosen.<br> <br> widget_list may also contain tuples such as:<br> ('flow', widget) always treat widget as a flow widget<br> ('fixed', height, widget) give this box widget a fixed height<br> ('weight', weight, widget) if the pile is treated as a box<br> widget then treat widget as a box widget with a<br> height based on its relative weight value, otherwise<br> treat widget as a flow widget<br> <br> widgets not in a tuple are the same as ('weight', 1, widget)<br> <br> If the pile is treated as a box widget there must be at least<br> one 'weight' tuple in widget_list.</tt></dd></dl> <dl><dt><a name="Pile-get_cursor_coords"><strong>get_cursor_coords</strong></a>(self, size)</dt><dd><tt>Return the cursor coordinates of the focus widget.</tt></dd></dl> <dl><dt><a name="Pile-get_focus"><strong>get_focus</strong></a>(self)</dt><dd><tt>Return the widget in focus.</tt></dd></dl> <dl><dt><a name="Pile-get_item_rows"><strong>get_item_rows</strong></a>(self, size, focus)</dt><dd><tt>Return a list of the number of rows used by each widget<br> in self.<strong>item_list</strong>.</tt></dd></dl> <dl><dt><a name="Pile-get_item_size"><strong>get_item_size</strong></a>(self, size, i, focus, item_rows<font color="#909090">=None</font>)</dt><dd><tt>Return a size appropriate for passing to self.<strong>widget_list</strong>[i]</tt></dd></dl> <dl><dt><a name="Pile-get_pref_col"><strong>get_pref_col</strong></a>(self, size)</dt><dd><tt>Return the preferred column for the cursor, or None.</tt></dd></dl> <dl><dt><a name="Pile-keypress"><strong>keypress</strong></a>(self, size, key)</dt><dd><tt>Pass the keypress to the widget in focus.<br> Unhandled 'up' and 'down' keys may cause a focus change.</tt></dd></dl> <dl><dt><a name="Pile-mouse_event"><strong>mouse_event</strong></a>(self, size, event, button, col, row, focus)</dt><dd><tt>Pass the event to the contained widget.<br> May change focus on button 1 press.</tt></dd></dl> <dl><dt><a name="Pile-move_cursor_to_coords"><strong>move_cursor_to_coords</strong></a>(self, size, col, row)</dt><dd><tt>Capture pref col and set new focus.</tt></dd></dl> <dl><dt><a name="Pile-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="Pile-rows"><strong>rows</strong></a> = cached_rows(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="Pile-selectable"><strong>selectable</strong></a>(self)</dt><dd><tt>Return True if the focus item is selectable.</tt></dd></dl> <dl><dt><a name="Pile-set_focus"><strong>set_focus</strong></a>(self, item)</dt><dd><tt>Set the item in focus. <br> <br> item -- widget or integer index</tt></dd></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="GridFlow"></a><h3>function GridFlow <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="GridFlow">class <strong>GridFlow</strong></a>(FlowWidget) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt> <dd>GridFlow</dd> <dd>FlowWidget</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="GridFlow-__init__"><strong>__init__</strong></a>(self, cells, cell_width, h_sep, v_sep, align)</dt><dd><tt>cells -- list of flow widgets to display<br> cell_width -- column width for each cell<br> h_sep -- blank columns between each cell horizontally<br> v_sep -- blank rows between cells vertically (if more than<br> one row is required to display all the cells)<br> align -- horizontal alignment of cells, see "align" parameter<br> of Padding widget for available options</tt></dd></dl> <dl><dt><a name="GridFlow-generate_display_widget"><strong>generate_display_widget</strong></a>(self, (maxcol,))</dt><dd><tt>Actually generate display widget (ignoring cache)</tt></dd></dl> <dl><dt><a name="GridFlow-get_cursor_coords"><strong>get_cursor_coords</strong></a>(self, (maxcol,))</dt><dd><tt>Get cursor from display widget.</tt></dd></dl> <dl><dt><a name="GridFlow-get_display_widget"><strong>get_display_widget</strong></a>(self, (maxcol,))</dt><dd><tt>Arrange the cells into columns (and possibly a pile) for <br> display, input or to calculate rows.</tt></dd></dl> <dl><dt><a name="GridFlow-get_pref_col"><strong>get_pref_col</strong></a>(self, (maxcol,))</dt><dd><tt>Return pref col from display widget.</tt></dd></dl> <dl><dt><a name="GridFlow-keypress"><strong>keypress</strong></a>(self, (maxcol,), key)</dt><dd><tt>Pass keypress to display widget for handling. <br> Capture focus changes.</tt></dd></dl> <dl><dt><a name="GridFlow-mouse_event"><strong>mouse_event</strong></a>(self, (maxcol,), event, button, col, row, focus)</dt><dd><tt>Send mouse event to contained widget.</tt></dd></dl> <dl><dt><a name="GridFlow-move_cursor_to_coords"><strong>move_cursor_to_coords</strong></a>(self, (maxcol,), col, row)</dt><dd><tt>Set the widget in focus based on the col + row.</tt></dd></dl> <dl><dt><a name="GridFlow-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="GridFlow-rows"><strong>rows</strong></a> = cached_rows(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="GridFlow-selectable"><strong>selectable</strong></a>(self)</dt><dd><tt>Return True if the cell in focus is selectable.</tt></dd></dl> <dl><dt><a name="GridFlow-set_focus"><strong>set_focus</strong></a>(self, cell)</dt><dd><tt>Set the cell in focus. <br> <br> cell -- widget or integer index into self.<strong>cells</strong></tt></dd></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="BoxAdapter"></a><h3>function BoxAdapter <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="BoxAdapter">class <strong>BoxAdapter</strong></a>(FlowWidget) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt> <dd>BoxAdapter</dd> <dd>FlowWidget</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="BoxAdapter-__getattr__"><strong>__getattr__</strong></a>(self, name)</dt><dd><tt>Pass calls to box widget.</tt></dd></dl> <dl><dt><a name="BoxAdapter-__init__"><strong>__init__</strong></a>(self, box_widget, height)</dt><dd><tt>Create a flow widget that contains a box widget<br> <br> box_widget -- box widget<br> height -- number of rows for box widget</tt></dd></dl> <dl><dt><a name="BoxAdapter-get_cursor_coords"><strong>get_cursor_coords</strong></a>(self, (maxcol,))</dt></dl> <dl><dt><a name="BoxAdapter-get_pref_col"><strong>get_pref_col</strong></a>(self, (maxcol,))</dt></dl> <dl><dt><a name="BoxAdapter-keypress"><strong>keypress</strong></a>(self, (maxcol,), key)</dt></dl> <dl><dt><a name="BoxAdapter-mouse_event"><strong>mouse_event</strong></a>(self, (maxcol,), event, button, col, row, focus)</dt></dl> <dl><dt><a name="BoxAdapter-move_cursor_to_coords"><strong>move_cursor_to_coords</strong></a>(self, (maxcol,), col, row)</dt></dl> <dl><dt><a name="BoxAdapter-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="BoxAdapter-rows"><strong>rows</strong></a>(self, (maxcol,), focus<font color="#909090">=False</font>)</dt><dd><tt>Return self.<strong>height</strong></tt></dd></dl> <dl><dt><a name="BoxAdapter-selectable"><strong>selectable</strong></a>(self)</dt><dd><tt>Return box widget's selectable value</tt></dd></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="Overlay"></a><h3>function Overlay <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="Overlay">class <strong>Overlay</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>Overlay</dd> <dd>BoxWidget</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="Overlay-__init__"><strong>__init__</strong></a>(self, top_w, bottom_w, align, width, valign, height, min_width<font color="#909090">=None</font>, min_height<font color="#909090">=None</font>)</dt><dd><tt>top_w -- a flow, box or fixed widget to overlay "on top"<br> bottom_w -- a box widget to appear "below" previous widget<br> align -- one of:<br> 'left', 'center', 'right'<br> ('fixed left', columns)<br> ('fixed right', columns)<br> ('relative', percentage 0=left 100=right)<br> width -- one of:<br> None if top_w is a fixed widget<br> number of columns wide<br> ('fixed right', columns) Only if align is 'fixed left'<br> ('fixed left', columns) Only if align is 'fixed right'<br> ('relative', percentage of total width)<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 top_w is a flow or fixed 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_width -- the minimum number of columns for top_w<br> when width is not fixed<br> min_height -- one of:<br> minimum number of rows for the widget when height not fixed<br> <br> Overlay widgets behave similarly to Padding and Filler widgets<br> when determining the size and position of top_w. bottom_w is<br> always rendered the full size available "below" top_w.</tt></dd></dl> <dl><dt><a name="Overlay-calculate_padding_filler"><strong>calculate_padding_filler</strong></a>(self, (maxcol, maxrow), focus)</dt><dd><tt>Return (padding left, right, filler top, bottom).</tt></dd></dl> <dl><dt><a name="Overlay-get_cursor_coords"><strong>get_cursor_coords</strong></a>(self, size)</dt><dd><tt>Return cursor coords from top_w, if any.</tt></dd></dl> <dl><dt><a name="Overlay-keypress"><strong>keypress</strong></a>(self, size, key)</dt><dd><tt>Pass keypress to top_w.</tt></dd></dl> <dl><dt><a name="Overlay-mouse_event"><strong>mouse_event</strong></a>(self, size, event, button, col, row, focus)</dt><dd><tt>Pass event to top_w, ignore if outside of top_w.</tt></dd></dl> <dl><dt><a name="Overlay-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="Overlay-selectable"><strong>selectable</strong></a>(self)</dt><dd><tt>Return selectable from top_w.</tt></dd></dl> <dl><dt><a name="Overlay-top_w_size"><strong>top_w_size</strong></a>(self, size, left, right, top, bottom)</dt><dd><tt>Return the size to pass to top_w.</tt></dd></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>Content widgets</h2><a name="Text"></a><h3>function Text <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="Text">class <strong>Text</strong></a>(FlowWidget) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt> <dd>Text</dd> <dd>FlowWidget</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="Text-__init__"><strong>__init__</strong></a>(self, markup, align<font color="#909090">='left'</font>, wrap<font color="#909090">='space'</font>, layout<font color="#909090">=None</font>)</dt><dd><tt>markup -- content of text widget, one of:<br> plain string -- string is displayed<br> ( attr, markup2 ) -- markup2 is given attribute attr<br> [ markupA, markupB, ... ] -- list items joined together<br> align -- align mode for text layout<br> wrap -- wrap mode for text layout<br> layout -- layout object to use, defaults to StandardTextLayout</tt></dd></dl> <dl><dt><a name="Text-get_line_translation"><strong>get_line_translation</strong></a>(self, maxcol, ta<font color="#909090">=None</font>)</dt><dd><tt>Return layout structure for mapping self.<strong>text</strong> to a canvas.</tt></dd></dl> <dl><dt><a name="Text-get_text"><strong>get_text</strong></a>(self)</dt><dd><tt>Returns (text, attributes).<br> <br> text -- complete string content of text widget<br> attributes -- run length encoded attributes for text</tt></dd></dl> <dl><dt><a name="Text-pack"><strong>pack</strong></a>(self, size<font color="#909090">=None</font>, focus<font color="#909090">=False</font>)</dt><dd><tt>Return the number of screen columns required for this Text<br> widget to be displayed without wrapping or clipping, as a <br> single element tuple.<br> <br> size -- None for unlimited screen columns or (maxcol,) to<br> specify a maximum column size</tt></dd></dl> <dl><dt><a name="Text-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="Text-rows"><strong>rows</strong></a> = cached_rows(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="Text-set_align_mode"><strong>set_align_mode</strong></a>(self, mode)</dt><dd><tt>Set text alignment / justification. <br> <br> Valid modes for StandardTextLayout are: <br> 'left', 'center' and 'right'</tt></dd></dl> <dl><dt><a name="Text-set_layout"><strong>set_layout</strong></a>(self, align, wrap, layout<font color="#909090">=None</font>)</dt><dd><tt>Set layout object, align and wrap modes.<br> <br> align -- align mode for text layout<br> wrap -- wrap mode for text layout<br> layout -- layout object to use, defaults to StandardTextLayout</tt></dd></dl> <dl><dt><a name="Text-set_text"><strong>set_text</strong></a>(self, markup)</dt><dd><tt>Set content of text widget.</tt></dd></dl> <dl><dt><a name="Text-set_wrap_mode"><strong>set_wrap_mode</strong></a>(self, mode)</dt><dd><tt>Set wrap mode. <br> <br> Valid modes for StandardTextLayout are :<br> 'any' : wrap at any character<br> 'space' : wrap on space character<br> 'clip' : truncate lines instead of wrapping</tt></dd></dl> <hr> Methods inherited from Widget:<br> <dl><dt><a name="Text-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="Edit"></a><h3>function Edit <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="Edit">class <strong>Edit</strong></a>(Text) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt> <dd>Edit</dd> <dd>Text</dd> <dd>FlowWidget</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="Edit-__init__"><strong>__init__</strong></a>(self, caption<font color="#909090">=''</font>, edit_text<font color="#909090">=''</font>, multiline<font color="#909090">=False</font>, align<font color="#909090">='left'</font>, wrap<font color="#909090">='space'</font>, allow_tab<font color="#909090">=False</font>, edit_pos<font color="#909090">=None</font>, layout<font color="#909090">=None</font>)</dt><dd><tt>caption -- markup for caption preceeding edit_text<br> edit_text -- text string for editing<br> multiline -- True: 'enter' inserts newline False: return it<br> align -- align mode<br> wrap -- wrap mode<br> allow_tab -- True: 'tab' inserts 1-8 spaces False: return it<br> edit_pos -- initial position for cursor, None:at end<br> layout -- layout object</tt></dd></dl> <dl><dt><a name="Edit-get_cursor_coords"><strong>get_cursor_coords</strong></a>(self, (maxcol,))</dt><dd><tt>Return the (x,y) coordinates of cursor within widget.</tt></dd></dl> <dl><dt><a name="Edit-get_edit_text"><strong>get_edit_text</strong></a>(self)</dt><dd><tt>Return the edit text for this widget.</tt></dd></dl> <dl><dt><a name="Edit-get_line_translation"><strong>get_line_translation</strong></a>(self, maxcol, ta<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="Edit-get_pref_col"><strong>get_pref_col</strong></a>(self, (maxcol,))</dt><dd><tt>Return the preferred column for the cursor, or the<br> current cursor x value.</tt></dd></dl> <dl><dt><a name="Edit-get_text"><strong>get_text</strong></a>(self)</dt><dd><tt>get_text() -> text, attributes<br> <br> text -- complete text of caption and edit_text<br> attributes -- run length encoded attributes for text</tt></dd></dl> <dl><dt><a name="Edit-insert_text"><strong>insert_text</strong></a>(self, text)</dt><dd><tt>Insert text at the cursor position and update cursor.</tt></dd></dl> <dl><dt><a name="Edit-keypress"><strong>keypress</strong></a>(self, (maxcol,), key)</dt><dd><tt>Handle editing keystrokes, return others.</tt></dd></dl> <dl><dt><a name="Edit-mouse_event"><strong>mouse_event</strong></a>(self, (maxcol,), event, button, x, y, focus)</dt><dd><tt>Move the cursor to the location clicked for button 1.</tt></dd></dl> <dl><dt><a name="Edit-move_cursor_to_coords"><strong>move_cursor_to_coords</strong></a>(self, (maxcol,), x, y)</dt><dd><tt>Set the cursor position with (x,y) coordinates.<br> <br> Returns True if move succeeded, False otherwise.</tt></dd></dl> <dl><dt><a name="Edit-position_coords"><strong>position_coords</strong></a>(self, maxcol, pos)</dt><dd><tt>Return (x,y) coordinates for an offset into self.<strong>edit_text</strong>.</tt></dd></dl> <dl><dt><a name="Edit-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="Edit-selectable"><strong>selectable</strong></a>(self)</dt></dl> <dl><dt><a name="Edit-set_caption"><strong>set_caption</strong></a>(self, caption)</dt><dd><tt>Set the caption markup for this widget.</tt></dd></dl> <dl><dt><a name="Edit-set_edit_pos"><strong>set_edit_pos</strong></a>(self, pos)</dt><dd><tt>Set the cursor position with a self.<strong>edit_text</strong> offset.</tt></dd></dl> <dl><dt><a name="Edit-set_edit_text"><strong>set_edit_text</strong></a>(self, text)</dt><dd><tt>Set the edit text for this widget.</tt></dd></dl> <dl><dt><a name="Edit-update_text"><strong>update_text</strong></a>(self)</dt><dd><tt>Deprecated. Use set_caption and/or set_edit_text instead.<br> <br> Make sure any cached line translation is not reused.</tt></dd></dl> <dl><dt><a name="Edit-valid_char"><strong>valid_char</strong></a>(self, ch)</dt><dd><tt>Return true for printable characters.</tt></dd></dl> <hr> Methods inherited from Text:<br> <dl><dt><a name="Edit-pack"><strong>pack</strong></a>(self, size<font color="#909090">=None</font>, focus<font color="#909090">=False</font>)</dt><dd><tt>Return the number of screen columns required for this Text<br> widget to be displayed without wrapping or clipping, as a <br> single element tuple.<br> <br> size -- None for unlimited screen columns or (maxcol,) to<br> specify a maximum column size</tt></dd></dl> <dl><dt><a name="Edit-rows"><strong>rows</strong></a> = cached_rows(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="Edit-set_align_mode"><strong>set_align_mode</strong></a>(self, mode)</dt><dd><tt>Set text alignment / justification. <br> <br> Valid modes for StandardTextLayout are: <br> 'left', 'center' and 'right'</tt></dd></dl> <dl><dt><a name="Edit-set_layout"><strong>set_layout</strong></a>(self, align, wrap, layout<font color="#909090">=None</font>)</dt><dd><tt>Set layout object, align and wrap modes.<br> <br> align -- align mode for text layout<br> wrap -- wrap mode for text layout<br> layout -- layout object to use, defaults to StandardTextLayout</tt></dd></dl> <dl><dt><a name="Edit-set_text"><strong>set_text</strong></a>(self, markup)</dt><dd><tt>Set content of text widget.</tt></dd></dl> <dl><dt><a name="Edit-set_wrap_mode"><strong>set_wrap_mode</strong></a>(self, mode)</dt><dd><tt>Set wrap mode. <br> <br> Valid modes for StandardTextLayout are :<br> 'any' : wrap at any character<br> 'space' : wrap on space character<br> 'clip' : truncate lines instead of wrapping</tt></dd></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="IntEdit"></a><h3>function IntEdit <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="IntEdit">class <strong>IntEdit</strong></a>(Edit) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt> <dd>IntEdit</dd> <dd>Edit</dd> <dd>Text</dd> <dd>FlowWidget</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="IntEdit-__init__"><strong>__init__</strong></a>(self, caption<font color="#909090">=''</font>, default<font color="#909090">=None</font>)</dt><dd><tt>caption -- caption markup<br> default -- default edit value</tt></dd></dl> <dl><dt><a name="IntEdit-keypress"><strong>keypress</strong></a>(self, (maxcol,), key)</dt><dd><tt>Handle editing keystrokes. Return others.</tt></dd></dl> <dl><dt><a name="IntEdit-valid_char"><strong>valid_char</strong></a>(self, ch)</dt><dd><tt>Return true for decimal digits.</tt></dd></dl> <dl><dt><a name="IntEdit-value"><strong>value</strong></a>(self)</dt><dd><tt>Return the numeric value of self.<strong>edit_text</strong>.</tt></dd></dl> <hr> Methods inherited from Edit:<br> <dl><dt><a name="IntEdit-get_cursor_coords"><strong>get_cursor_coords</strong></a>(self, (maxcol,))</dt><dd><tt>Return the (x,y) coordinates of cursor within widget.</tt></dd></dl> <dl><dt><a name="IntEdit-get_edit_text"><strong>get_edit_text</strong></a>(self)</dt><dd><tt>Return the edit text for this widget.</tt></dd></dl> <dl><dt><a name="IntEdit-get_line_translation"><strong>get_line_translation</strong></a>(self, maxcol, ta<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="IntEdit-get_pref_col"><strong>get_pref_col</strong></a>(self, (maxcol,))</dt><dd><tt>Return the preferred column for the cursor, or the<br> current cursor x value.</tt></dd></dl> <dl><dt><a name="IntEdit-get_text"><strong>get_text</strong></a>(self)</dt><dd><tt>get_text() -> text, attributes<br> <br> text -- complete text of caption and edit_text<br> attributes -- run length encoded attributes for text</tt></dd></dl> <dl><dt><a name="IntEdit-insert_text"><strong>insert_text</strong></a>(self, text)</dt><dd><tt>Insert text at the cursor position and update cursor.</tt></dd></dl> <dl><dt><a name="IntEdit-mouse_event"><strong>mouse_event</strong></a>(self, (maxcol,), event, button, x, y, focus)</dt><dd><tt>Move the cursor to the location clicked for button 1.</tt></dd></dl> <dl><dt><a name="IntEdit-move_cursor_to_coords"><strong>move_cursor_to_coords</strong></a>(self, (maxcol,), x, y)</dt><dd><tt>Set the cursor position with (x,y) coordinates.<br> <br> Returns True if move succeeded, False otherwise.</tt></dd></dl> <dl><dt><a name="IntEdit-position_coords"><strong>position_coords</strong></a>(self, maxcol, pos)</dt><dd><tt>Return (x,y) coordinates for an offset into self.<strong>edit_text</strong>.</tt></dd></dl> <dl><dt><a name="IntEdit-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="IntEdit-selectable"><strong>selectable</strong></a>(self)</dt></dl> <dl><dt><a name="IntEdit-set_caption"><strong>set_caption</strong></a>(self, caption)</dt><dd><tt>Set the caption markup for this widget.</tt></dd></dl> <dl><dt><a name="IntEdit-set_edit_pos"><strong>set_edit_pos</strong></a>(self, pos)</dt><dd><tt>Set the cursor position with a self.<strong>edit_text</strong> offset.</tt></dd></dl> <dl><dt><a name="IntEdit-set_edit_text"><strong>set_edit_text</strong></a>(self, text)</dt><dd><tt>Set the edit text for this widget.</tt></dd></dl> <dl><dt><a name="IntEdit-update_text"><strong>update_text</strong></a>(self)</dt><dd><tt>Deprecated. Use set_caption and/or set_edit_text instead.<br> <br> Make sure any cached line translation is not reused.</tt></dd></dl> <hr> Methods inherited from Text:<br> <dl><dt><a name="IntEdit-pack"><strong>pack</strong></a>(self, size<font color="#909090">=None</font>, focus<font color="#909090">=False</font>)</dt><dd><tt>Return the number of screen columns required for this Text<br> widget to be displayed without wrapping or clipping, as a <br> single element tuple.<br> <br> size -- None for unlimited screen columns or (maxcol,) to<br> specify a maximum column size</tt></dd></dl> <dl><dt><a name="IntEdit-rows"><strong>rows</strong></a> = cached_rows(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="IntEdit-set_align_mode"><strong>set_align_mode</strong></a>(self, mode)</dt><dd><tt>Set text alignment / justification. <br> <br> Valid modes for StandardTextLayout are: <br> 'left', 'center' and 'right'</tt></dd></dl> <dl><dt><a name="IntEdit-set_layout"><strong>set_layout</strong></a>(self, align, wrap, layout<font color="#909090">=None</font>)</dt><dd><tt>Set layout object, align and wrap modes.<br> <br> align -- align mode for text layout<br> wrap -- wrap mode for text layout<br> layout -- layout object to use, defaults to StandardTextLayout</tt></dd></dl> <dl><dt><a name="IntEdit-set_text"><strong>set_text</strong></a>(self, markup)</dt><dd><tt>Set content of text widget.</tt></dd></dl> <dl><dt><a name="IntEdit-set_wrap_mode"><strong>set_wrap_mode</strong></a>(self, mode)</dt><dd><tt>Set wrap mode. <br> <br> Valid modes for StandardTextLayout are :<br> 'any' : wrap at any character<br> 'space' : wrap on space character<br> 'clip' : truncate lines instead of wrapping</tt></dd></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="Button"></a><h3>function Button <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="Button">class <strong>Button</strong></a>(WidgetWrap) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt> <dd>Button</dd> <dd>WidgetWrap</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="Button-__init__"><strong>__init__</strong></a>(self, label, on_press<font color="#909090">=None</font>, user_data<font color="#909090">=None</font>)</dt><dd><tt>label -- markup for button label<br> on_press -- callback function for button "press"<br> on_press( button object, user_data=None)<br> user_data -- additional param for on_press callback,<br> ommited if None for compatibility reasons</tt></dd></dl> <dl><dt><a name="Button-get_cursor_coords"><strong>get_cursor_coords</strong></a>(self, (maxcol,))</dt><dd><tt>Return the location of the cursor.</tt></dd></dl> <dl><dt><a name="Button-get_label"><strong>get_label</strong></a>(self)</dt></dl> <dl><dt><a name="Button-keypress"><strong>keypress</strong></a>(self, (maxcol,), key)</dt><dd><tt>Call on_press on spage or enter.</tt></dd></dl> <dl><dt><a name="Button-mouse_event"><strong>mouse_event</strong></a>(self, (maxcol,), event, button, x, y, focus)</dt><dd><tt>Call on_press on button 1 press.</tt></dd></dl> <dl><dt><a name="Button-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="Button-selectable"><strong>selectable</strong></a>(self)</dt></dl> <dl><dt><a name="Button-set_label"><strong>set_label</strong></a>(self, label)</dt></dl> <hr> Data and other attributes defined here:<br> <dl><dt><strong>button_left</strong> = <urwid.widget.Text object at 0x1dfe550></dl> <dl><dt><strong>button_right</strong> = <urwid.widget.Text object at 0x1dfe5d0></dl> <hr> Methods inherited from WidgetWrap:<br> <dl><dt><a name="Button-__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="Button-get_w"><strong>get_w</strong></a>(self)</dt></dl> <dl><dt><a name="Button-set_w"><strong>set_w</strong></a>(self, w)</dt></dl> <hr> Data descriptors inherited from WidgetWrap:<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="CheckBox"></a><h3>function CheckBox <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="CheckBox">class <strong>CheckBox</strong></a>(WidgetWrap) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt> <dd>CheckBox</dd> <dd>WidgetWrap</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="CheckBox-__init__"><strong>__init__</strong></a>(self, label, state<font color="#909090">=False</font>, has_mixed<font color="#909090">=False</font>, on_state_change<font color="#909090">=None</font>, user_data<font color="#909090">=None</font>)</dt><dd><tt>label -- markup for check box label<br> state -- False, True or "mixed"<br> has_mixed -- True if "mixed" is a state to cycle through<br> on_state_change -- callback function for state changes<br> on_state_change( check box, new state,<br> user_data=None)<br> user_data -- additional param for on_press callback,<br> ommited if None for compatibility reasons</tt></dd></dl> <dl><dt><a name="CheckBox-get_label"><strong>get_label</strong></a>(self)</dt><dd><tt>Return label text.</tt></dd></dl> <dl><dt><a name="CheckBox-get_state"><strong>get_state</strong></a>(self)</dt><dd><tt>Return the state of the checkbox.</tt></dd></dl> <dl><dt><a name="CheckBox-keypress"><strong>keypress</strong></a>(self, (maxcol,), key)</dt><dd><tt>Toggle state on space or enter.</tt></dd></dl> <dl><dt><a name="CheckBox-mouse_event"><strong>mouse_event</strong></a>(self, (maxcol,), event, button, x, y, focus)</dt><dd><tt>Toggle state on button 1 press.</tt></dd></dl> <dl><dt><a name="CheckBox-selectable"><strong>selectable</strong></a>(self)</dt></dl> <dl><dt><a name="CheckBox-set_label"><strong>set_label</strong></a>(self, label)</dt><dd><tt>Change the check box label.</tt></dd></dl> <dl><dt><a name="CheckBox-set_state"><strong>set_state</strong></a>(self, state, do_callback<font color="#909090">=True</font>)</dt><dd><tt>Call on_state_change if do_callback is True,<br> then change the check box state.</tt></dd></dl> <dl><dt><a name="CheckBox-toggle_state"><strong>toggle_state</strong></a>(self)</dt><dd><tt>Cycle to the next valid state.</tt></dd></dl> <hr> Data and other attributes defined here:<br> <dl><dt><strong>reserve_columns</strong> = 4</dl> <dl><dt><strong>states</strong> = {False: <urwid.widget.SelectableIcon object at 0x1dfe350>, True: <urwid.widget.SelectableIcon object at 0x1dfe2d0>, 'mixed': <urwid.widget.SelectableIcon object at 0x1dfe390>}</dl> <hr> Methods inherited from WidgetWrap:<br> <dl><dt><a name="CheckBox-__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="CheckBox-get_w"><strong>get_w</strong></a>(self)</dt></dl> <dl><dt><a name="CheckBox-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="CheckBox-set_w"><strong>set_w</strong></a>(self, w)</dt></dl> <hr> Data descriptors inherited from WidgetWrap:<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="RadioButton"></a><h3>function RadioButton <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="RadioButton">class <strong>RadioButton</strong></a>(WidgetWrap) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt> <dd>RadioButton</dd> <dd>WidgetWrap</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="RadioButton-__init__"><strong>__init__</strong></a>(self, group, label, state<font color="#909090">='first True'</font>, on_state_change<font color="#909090">=None</font>, user_data<font color="#909090">=None</font>)</dt><dd><tt>group -- list for radio buttons in same group<br> label -- markup for radio button label<br> state -- False, True, "mixed" or "first True"<br> on_state_change -- callback function for state changes<br> on_state_change( radio_button, new_state,<br> user_data=None)<br> user_data -- additional param for on_press callback,<br> ommited if None for compatibility reasons<br> <br> This function will append the new radio button to group.<br> "first True" will set to True if group is empty.</tt></dd></dl> <dl><dt><a name="RadioButton-get_label"><strong>get_label</strong></a>(self)</dt><dd><tt>Return label text.</tt></dd></dl> <dl><dt><a name="RadioButton-get_state"><strong>get_state</strong></a>(self)</dt><dd><tt>Return the state of the radio button.</tt></dd></dl> <dl><dt><a name="RadioButton-keypress"><strong>keypress</strong></a>(self, (maxcol,), key)</dt><dd><tt>Set state to True on space or enter.</tt></dd></dl> <dl><dt><a name="RadioButton-mouse_event"><strong>mouse_event</strong></a>(self, (maxcol,), event, button, x, y, focus)</dt><dd><tt>Set state to True on button 1 press.</tt></dd></dl> <dl><dt><a name="RadioButton-selectable"><strong>selectable</strong></a>(self)</dt></dl> <dl><dt><a name="RadioButton-set_label"><strong>set_label</strong></a>(self, label)</dt><dd><tt>Change the check box label.</tt></dd></dl> <dl><dt><a name="RadioButton-set_state"><strong>set_state</strong></a>(self, state, do_callback<font color="#909090">=True</font>)</dt><dd><tt>Call on_state_change if do_callback is True,<br> then change the radio button state.<br> if state is True set all other radio buttons in group to False.</tt></dd></dl> <hr> Data and other attributes defined here:<br> <dl><dt><strong>reserve_columns</strong> = 4</dl> <dl><dt><strong>states</strong> = {False: <urwid.widget.SelectableIcon object at 0x1dfe490>, True: <urwid.widget.SelectableIcon object at 0x1dfe410>, 'mixed': <urwid.widget.SelectableIcon object at 0x1dfe4d0>}</dl> <hr> Methods inherited from WidgetWrap:<br> <dl><dt><a name="RadioButton-__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="RadioButton-get_w"><strong>get_w</strong></a>(self)</dt></dl> <dl><dt><a name="RadioButton-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="RadioButton-set_w"><strong>set_w</strong></a>(self, w)</dt></dl> <hr> Data descriptors inherited from WidgetWrap:<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> <h2>Graphics</h2><a name="BarGraph"></a><h3>function BarGraph <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="BarGraph">class <strong>BarGraph</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>BarGraph</dd> <dd>BoxWidget</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="BarGraph-__init__"><strong>__init__</strong></a>(self, attlist, hatt<font color="#909090">=None</font>, satt<font color="#909090">=None</font>)</dt><dd><tt>Create a bar graph with the passed display characteristics.<br> see set_segment_attributes for a description of the parameters.</tt></dd></dl> <dl><dt><a name="BarGraph-calculate_bar_widths"><strong>calculate_bar_widths</strong></a>(self, (maxcol, maxrow), bardata)</dt><dd><tt>Return a list of bar widths, one for each bar in data.<br> <br> If self.<strong>bar_width</strong> is None this implementation will stretch <br> the bars across the available space specified by maxcol.</tt></dd></dl> <dl><dt><a name="BarGraph-calculate_display"><strong>calculate_display</strong></a>(self, (maxcol, maxrow))</dt><dd><tt>Calculate display data.</tt></dd></dl> <dl><dt><a name="BarGraph-hlines_display"><strong>hlines_display</strong></a>(self, disp, top, hlines, maxrow)</dt><dd><tt>Add hlines to display structure represented as bar_type tuple<br> values:<br> (bg, 0-5)<br> bg is the segment that has the hline on it<br> 0-5 is the hline graphic to use where 0 is a regular underscore<br> and 1-5 are the UTF-8 horizontal scan line characters.</tt></dd></dl> <dl><dt><a name="BarGraph-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="BarGraph-selectable"><strong>selectable</strong></a>(self)</dt><dd><tt>Return False.</tt></dd></dl> <dl><dt><a name="BarGraph-set_bar_width"><strong>set_bar_width</strong></a>(self, width)</dt><dd><tt>Set a preferred bar width for calculate_bar_widths to use.<br> <br> width -- width of bar or None for automatic width adjustment</tt></dd></dl> <dl><dt><a name="BarGraph-set_data"><strong>set_data</strong></a>(self, bardata, top, hlines<font color="#909090">=None</font>)</dt><dd><tt>Store bar data, bargraph top and horizontal line positions.<br> <br> bardata -- a list of bar values.<br> top -- maximum value for segments within bardata<br> hlines -- None or a bar value marking horizontal line positions<br> <br> bar values are [ segment1, segment2, ... ] lists where top is <br> the maximal value corresponding to the top of the bar graph and<br> segment1, segment2, ... are the values for the top of each <br> segment of this bar. Simple bar graphs will only have one<br> segment in each bar value.<br> <br> Eg: if top is 100 and there is a bar value of [ 80, 30 ] then<br> the top of this bar will be at 80% of full height of the graph<br> and it will have a second segment that starts at 30%.</tt></dd></dl> <dl><dt><a name="BarGraph-set_segment_attributes"><strong>set_segment_attributes</strong></a>(self, attlist, hatt<font color="#909090">=None</font>, satt<font color="#909090">=None</font>)</dt><dd><tt>attlist -- list containing attribute or (attribute, character)<br> tuple for background, first segment, and optionally<br> following segments. ie. len(attlist) == num segments+1<br> character defaults to ' ' if not specified.<br> hatt -- list containing attributes for horizontal lines. First <br> lement is for lines on background, second is for lines<br> on first segment, third is for lines on second segment<br> etc..<br> satt -- dictionary containing attributes for smoothed <br> transitions of bars in UTF-8 display mode. The values<br> are in the form:<br> (fg,bg) : attr<br> fg and bg are integers where 0 is the graph background,<br> 1 is the first segment, 2 is the second, ... <br> fg > bg in all values. attr is an attribute with a <br> foreground corresponding to fg and a background <br> corresponding to bg.<br> <br> If satt is not None and the bar graph is being displayed in<br> a terminal using the UTF-8 encoding then the character cell<br> that is shared between the segments specified will be smoothed<br> with using the UTF-8 vertical eighth characters.<br> <br> eg: set_segment_attributes( ['no', ('unsure',"?"), 'yes'] )<br> will use the attribute 'no' for the background (the area from<br> the top of the graph to the top of the bar), question marks <br> with the attribute 'unsure' will be used for the topmost <br> segment of the bar, and the attribute 'yes' will be used for<br> the bottom segment of the bar.</tt></dd></dl> <dl><dt><a name="BarGraph-smooth_display"><strong>smooth_display</strong></a>(self, disp)</dt><dd><tt>smooth (col, row*8) display into (col, row) display using<br> UTF vertical eighth characters represented as bar_type<br> tuple values:<br> ( fg, bg, 1-7 )<br> where fg is the lower segment, bg is the upper segment and<br> 1-7 is the vertical eighth character to use.</tt></dd></dl> <dl><dt><a name="BarGraph-use_smoothed"><strong>use_smoothed</strong></a>(self)</dt></dl> <hr> Data descriptors defined here:<br> <dl><dt><strong>get_data</strong></dt> </dl> <hr> Data and other attributes defined here:<br> <dl><dt><strong>__metaclass__</strong> = <class 'urwid.graphics.BarGraphMeta'><dd><tt>Detect subclass get_data() method and dynamic change to<br> get_data() method and disable caching in these cases.<br> <br> This is for backwards compatibility only, new programs<br> should use set_data() instead of overriding get_data().</tt></dl> <dl><dt><strong>eighths</strong> = u' <font color="#c040c0">\u2581\u2582\u2583\u2584\u2585\u2586\u2587</font>'</dl> <dl><dt><strong>hlines</strong> = u'_<font color="#c040c0">\u23ba\u23bb\u2500\u23bc\u23bd</font>'</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> <a name="GraphVScale"></a><h3>function GraphVScale <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="GraphVScale">class <strong>GraphVScale</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>GraphVScale</dd> <dd>BoxWidget</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="GraphVScale-__init__"><strong>__init__</strong></a>(self, labels, top)</dt><dd><tt>GraphVScale( [(label1 position, label1 markup),...], top )<br> label position -- 0 < position < top for the y position<br> label markup -- text markup for this label<br> top -- top y position<br> <br> This widget is a vertical scale for the BarGraph widget that<br> can correspond to the BarGraph's horizontal lines</tt></dd></dl> <dl><dt><a name="GraphVScale-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="GraphVScale-selectable"><strong>selectable</strong></a>(self)</dt><dd><tt>Return False.</tt></dd></dl> <dl><dt><a name="GraphVScale-set_scale"><strong>set_scale</strong></a>(self, labels, top)</dt><dd><tt>set_scale( [(label1 position, label1 markup),...], top )<br> label position -- 0 < position < top for the y position<br> label markup -- text markup for this label<br> top -- top y position</tt></dd></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="ProgressBar"></a><h3>function ProgressBar <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="ProgressBar">class <strong>ProgressBar</strong></a>(FlowWidget) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt> <dd>ProgressBar</dd> <dd>FlowWidget</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="ProgressBar-__init__"><strong>__init__</strong></a>(self, normal, complete, current<font color="#909090">=0</font>, done<font color="#909090">=100</font>, satt<font color="#909090">=None</font>)</dt><dd><tt>normal -- attribute for uncomplete part of progress bar<br> complete -- attribute for complete part of progress bar<br> current -- current progress<br> done -- progress amount at 100%<br> satt -- attribute for smoothed part of bar where the foreground<br> of satt corresponds to the normal part and the<br> background corresponds to the complete part. If satt<br> is None then no smoothing will be done.</tt></dd></dl> <dl><dt><a name="ProgressBar-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="ProgressBar-rows"><strong>rows</strong></a> = cached_rows(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="ProgressBar-set_completion"><strong>set_completion</strong></a>(self, current)</dt><dd><tt>current -- current progress</tt></dd></dl> <hr> Data and other attributes defined here:<br> <dl><dt><strong>eighths</strong> = u' <font color="#c040c0">\u258f\u258e\u258d\u258c\u258b\u258a\u2589</font>'</dl> <hr> Methods inherited from Widget:<br> <dl><dt><a name="ProgressBar-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="BigText"></a><h3>function BigText <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="BigText">class <strong>BigText</strong></a>(FixedWidget) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt> <dd>BigText</dd> <dd>FixedWidget</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="BigText-__init__"><strong>__init__</strong></a>(self, markup, font)</dt><dd><tt>markup -- same as Text widget markup<br> font -- instance of a Font class</tt></dd></dl> <dl><dt><a name="BigText-get_text"><strong>get_text</strong></a>(self)</dt><dd><tt>Returns (text, attributes).</tt></dd></dl> <dl><dt><a name="BigText-pack"><strong>pack</strong></a>(self, size<font color="#909090">=None</font>, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="BigText-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="BigText-set_font"><strong>set_font</strong></a>(self, font)</dt></dl> <dl><dt><a name="BigText-set_text"><strong>set_text</strong></a>(self, markup)</dt></dl> <hr> Methods inherited from Widget:<br> <dl><dt><a name="BigText-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="get_all_fonts"></a><h3>function get_all_fonts <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt><a name="-get_all_fonts"><strong>get_all_fonts</strong></a>()</dt><dd><tt>Return a list of (font name, font class) tuples.</tt></dd></dl> <h2>Abstract widgets & interfaces</h2><h3><a name="Widget_interface_definition"></a><strong>Widget interface definition</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="WidgetInterface-get_cursor_coords"><strong>get_cursor_coords</strong></a>(self, size)</dt><dd><tt>size -- flow widgets: (maxcol,) box widgets: (maxcol,maxrow)<br> where maxcol and maxrow are the maximum screen columns<br> and rows for the widget when rendered<br> <br> Returns (col,row) coordinates for cursor or None if no cursor.<br> <br> MUST be implemented if render function returns a canvas with<br> a cursor. <br> MUST match the cursor in the canvas returned by render function<br> when focus=True.<br> Caller MUST treat no implementation as equivalent to an <br> implementation that always returns None.</tt></dd></dl> <dl><dt><a name="WidgetInterface-get_pref_col"><strong>get_pref_col</strong></a>(self, size)</dt><dd><tt>size -- flow widgets: (maxcol,) box widgets: (maxcol,maxrow)<br> where maxcol and maxrow are the maximum screen columns<br> and rows for the widget when rendered<br> <br> Returns the preferred screen column as an integer or None.<br> <br> Caller MUST treat no implementation as equivalent to an <br> implementation that always returns None.</tt></dd></dl> <dl><dt><a name="WidgetInterface-keypress"><strong>keypress</strong></a>(self, size, key)</dt><dd><tt>size -- flow widgets: (maxcol,) box widgets: (maxcol,maxrow)<br> where maxcol and maxrow are the maximum screen columns<br> and rows for the widget when rendered<br> key -- key pressed<br> <br> Returns None if key was handled, returns key if not handled.<br> <br> MUST be implemented if selectable function returns True.<br> MUST NOT be called if selectable function returns False.</tt></dd></dl> <dl><dt><a name="WidgetInterface-mouse_event"><strong>mouse_event</strong></a>(self, size, event, button, col, row, focus)</dt><dd><tt>size -- flow widgets: (maxcol,) box widgets: (maxcol,maxrow)<br> where maxcol and maxrow are the maximum screen columns<br> and rows for the widget when rendered<br> event -- event part of mouse event structure, eg. 'press',<br> 'release', 'drag', 'meta press' etc..<br> button -- button number for event between 1 and 5, may be 0<br> on button release events if button is unknown<br> col -- screen column of event, relative to left edge of widget<br> row -- screen row of event, relative to top edge of widget<br> focus -- True if this widget is in focus<br> <br> Returns True if event was handled, False otherwise.<br> <br> Caller MUST treat no implementation as equivalent to an<br> implementation that always returns False.</tt></dd></dl> <dl><dt><a name="WidgetInterface-move_cursor_to_coords"><strong>move_cursor_to_coords</strong></a>(self, size, col, row)</dt><dd><tt>size -- flow widgets: (maxcol,) box widgets: (maxcol,maxrow)<br> where maxcol and maxrow are the maximum screen columns<br> and rows for the widget when rendered<br> col -- desired screen column for cursor to appear, relative<br> to left edge of widget<br> row -- desired screen row for cursor to appear, relative to<br> top edge of widget<br> <br> Returns True on success, False on failure.<br> <br> MUST succeed if there is any column on passed row that the<br> cursor may be moved to.<br> Caller MUST treat no implementation as equivalent to an<br> implementation that always returns True.</tt></dd></dl> <dl><dt><a name="WidgetInterface-render"><strong>render</strong></a>(self, size, focus<font color="#909090">=False</font>)</dt><dd><tt>size -- flow widgets: (maxcol,) box widgets: (maxcol,maxrow)<br> where maxcol and maxrow are the maximum screen columns<br> and rows for the canvas returned<br> focus -- True if this widget is in focus<br> <br> Returns a canvas object.<br> <br> MUST be implemented.<br> MUST NOT return a canvas with a cursor when focus=False.</tt></dd></dl> <dl><dt><a name="WidgetInterface-rows"><strong>rows</strong></a>(self, (maxcol,), focus<font color="#909090">=False</font>)</dt><dd><tt>maxcol -- maximum screen columns for rendered widget<br> focus -- True if this widget is in focus<br> <br> Returns an integer number or screen rows required.<br> <br> MUST be implemented by all flow widgets.<br> MUST match the number of rows in the canvas returned by<br> render function called with the same parameters.</tt></dd></dl> <dl><dt><a name="WidgetInterface-selectable"><strong>selectable</strong></a>(self)</dt><dd><tt>Returns True if this widget will accept keyboard input and<br> should take the focus when changing focus between widgets.<br> <br> MUST be implemented.</tt></dd></dl> <a name="Widget"></a><h3>function Widget <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="Widget">class <strong>Widget</strong></a>(object) <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="Widget-selectable"><strong>selectable</strong></a>(self)</dt></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> <hr> Data and other attributes defined here:<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="BoxWidget"></a><h3>function BoxWidget <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="BoxWidget">class <strong>BoxWidget</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>BoxWidget</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="BoxWidget-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <hr> Methods inherited from Widget:<br> <dl><dt><a name="BoxWidget-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="FlowWidget"></a><h3>function FlowWidget <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="FlowWidget">class <strong>FlowWidget</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>FlowWidget</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="FlowWidget-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <dl><dt><a name="FlowWidget-rows"><strong>rows</strong></a> = cached_rows(self, size, focus<font color="#909090">=False</font>)</dt></dl> <hr> Methods inherited from Widget:<br> <dl><dt><a name="FlowWidget-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="FixedWidget"></a><h3>function FixedWidget <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="FixedWidget">class <strong>FixedWidget</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>FixedWidget</dd> <dd>Widget</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="FixedWidget-pack"><strong>pack</strong></a>(self, size<font color="#909090">=None</font>, focus<font color="#909090">=False</font>)</dt><dd><tt>All fixed widgets must implement this function.</tt></dd></dl> <dl><dt><a name="FixedWidget-render"><strong>render</strong></a> = cached_render(self, size, focus<font color="#909090">=False</font>)</dt></dl> <hr> Methods inherited from Widget:<br> <dl><dt><a name="FixedWidget-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> <h3><a name="List_Walker_interface_definition"></a><strong>List Walker interface definition</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="ListWalkerInterface-get_focus"><strong>get_focus</strong></a>(self)</dt><dd><tt>Returns (widget, position).<br> <br> MUST be implemented.<br> Caller MUST NOT assume that position object may be stored and<br> reused after contents of list change.</tt></dd></dl> <dl><dt><a name="ListWalkerInterface-get_next"><strong>get_next</strong></a>(self, position)</dt><dd><tt>position -- a position returned by get_focus or get_next<br> <br> Returns (widget below, position below).<br> <br> MUST be implemented.<br> Caller MUST NOT assume that position object may be stored and<br> reused after contents of list change.</tt></dd></dl> <dl><dt><a name="ListWalkerInterface-get_prev"><strong>get_prev</strong></a>(self, position)</dt><dd><tt>position -- a position returned by get_focus or get_prev<br> <br> Returns (widget above, position above).<br> <br> MUST be implemented.<br> Caller MUST NOT assume that position object may be stored and<br> reused after contents of list change.</tt></dd></dl> <dl><dt><a name="ListWalkerInterface-set_focus"><strong>set_focus</strong></a>(self, position)</dt><dd><tt>position -- a position returned by get_focus, get_next or<br> get_prev<br> <br> Returns None.<br> <br> MUST be implemented. Should send "modified" signal (or call<br> self.<strong>_modified</strong> if inheriting from ListWalker)</tt></dd></dl> <a name="ListWalker"></a><h3>function ListWalker <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="ListWalker">class <strong>ListWalker</strong></a>(object) <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="ListWalker-__hash__"><strong>__hash__</strong></a>(self)</dt></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> <hr> Data and other attributes defined here:<br> <dl><dt><strong>__metaclass__</strong> = <class 'urwid.util.MetaSignals'><dd><tt>register the list of signals in the class varable signals,<br> including signals in superclasses.</tt></dl> <dl><dt><strong>signals</strong> = ['modified']</dl> <h2>ListBox list walkers</h2><a name="PollingListWalker"></a><h3>function PollingListWalker <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="PollingListWalker">class <strong>PollingListWalker</strong></a>(object) <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="PollingListWalker-__init__"><strong>__init__</strong></a>(self, contents)</dt><dd><tt>contents -- list to poll for changes</tt></dd></dl> <dl><dt><a name="PollingListWalker-get_focus"><strong>get_focus</strong></a>(self)</dt><dd><tt>Return (focus widget, focus position).</tt></dd></dl> <dl><dt><a name="PollingListWalker-get_next"><strong>get_next</strong></a>(self, start_from)</dt><dd><tt>Return (widget after start_from, position after start_from).</tt></dd></dl> <dl><dt><a name="PollingListWalker-get_prev"><strong>get_prev</strong></a>(self, start_from)</dt><dd><tt>Return (widget before start_from, position before start_from).</tt></dd></dl> <dl><dt><a name="PollingListWalker-set_focus"><strong>set_focus</strong></a>(self, position)</dt><dd><tt>Set focus position.</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> <a name="SimpleListWalker"></a><h3>function SimpleListWalker <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="SimpleListWalker">class <strong>SimpleListWalker</strong></a>(MonitoredList, ListWalker) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt> <dd>SimpleListWalker</dd> <dd>MonitoredList</dd> <dd>list</dd> <dd>ListWalker</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="SimpleListWalker-__hash__"><strong>__hash__</strong></a>(self)</dt></dl> <dl><dt><a name="SimpleListWalker-__init__"><strong>__init__</strong></a>(self, contents)</dt><dd><tt>contents -- list to copy into this object<br> <br> Changes made to this object (when it is treated as a list) are<br> detected automatically and will cause ListBox objects using<br> this list walker to be updated.</tt></dd></dl> <dl><dt><a name="SimpleListWalker-get_focus"><strong>get_focus</strong></a>(self)</dt><dd><tt>Return (focus widget, focus position).</tt></dd></dl> <dl><dt><a name="SimpleListWalker-get_next"><strong>get_next</strong></a>(self, start_from)</dt><dd><tt>Return (widget after start_from, position after start_from).</tt></dd></dl> <dl><dt><a name="SimpleListWalker-get_prev"><strong>get_prev</strong></a>(self, start_from)</dt><dd><tt>Return (widget before start_from, position before start_from).</tt></dd></dl> <dl><dt><a name="SimpleListWalker-set_focus"><strong>set_focus</strong></a>(self, position)</dt><dd><tt>Set focus position.</tt></dd></dl> <dl><dt><a name="SimpleListWalker-set_modified_callback"><strong>set_modified_callback</strong></a>(self, callback)</dt><dd><tt>This function inherited from MonitoredList is not <br> implemented in SimleListWalker.<br> <br> Use Signals.connect(list_walker, "modified", ...) instead.</tt></dd></dl> <hr> Data descriptors defined here:<br> <dl><dt><strong>contents</strong></dt> <dd><tt>Return self.<br> <br> Provides compatibility with old SimpleListWalker class.</tt></dd> </dl> <hr> Methods inherited from MonitoredList:<br> <dl><dt><a name="SimpleListWalker-__add__"><strong>__add__</strong></a> = call_modified_wrapper(self, *args)</dt></dl> <dl><dt><a name="SimpleListWalker-__delitem__"><strong>__delitem__</strong></a> = call_modified_wrapper(self, *args)</dt></dl> <dl><dt><a name="SimpleListWalker-__delslice__"><strong>__delslice__</strong></a> = call_modified_wrapper(self, *args)</dt></dl> <dl><dt><a name="SimpleListWalker-__iadd__"><strong>__iadd__</strong></a> = call_modified_wrapper(self, *args)</dt></dl> <dl><dt><a name="SimpleListWalker-__imul__"><strong>__imul__</strong></a> = call_modified_wrapper(self, *args)</dt></dl> <dl><dt><a name="SimpleListWalker-__repr__"><strong>__repr__</strong></a>(self)</dt></dl> <dl><dt><a name="SimpleListWalker-__rmul__"><strong>__rmul__</strong></a> = call_modified_wrapper(self, *args)</dt></dl> <dl><dt><a name="SimpleListWalker-__setitem__"><strong>__setitem__</strong></a> = call_modified_wrapper(self, *args)</dt></dl> <dl><dt><a name="SimpleListWalker-__setslice__"><strong>__setslice__</strong></a> = call_modified_wrapper(self, *args)</dt></dl> <dl><dt><a name="SimpleListWalker-append"><strong>append</strong></a> = call_modified_wrapper(self, *args)</dt></dl> <dl><dt><a name="SimpleListWalker-extend"><strong>extend</strong></a> = call_modified_wrapper(self, *args)</dt></dl> <dl><dt><a name="SimpleListWalker-insert"><strong>insert</strong></a> = call_modified_wrapper(self, *args)</dt></dl> <dl><dt><a name="SimpleListWalker-pop"><strong>pop</strong></a> = call_modified_wrapper(self, *args)</dt></dl> <dl><dt><a name="SimpleListWalker-remove"><strong>remove</strong></a> = call_modified_wrapper(self, *args)</dt></dl> <dl><dt><a name="SimpleListWalker-reverse"><strong>reverse</strong></a> = call_modified_wrapper(self, *args)</dt></dl> <dl><dt><a name="SimpleListWalker-sort"><strong>sort</strong></a> = call_modified_wrapper(self, *args)</dt></dl> <hr> Data descriptors inherited from MonitoredList:<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> Methods inherited from list:<br> <dl><dt><a name="SimpleListWalker-__contains__"><strong>__contains__</strong></a>(...)</dt><dd><tt>x.__contains__(y) <==> y in x</tt></dd></dl> <dl><dt><a name="SimpleListWalker-__eq__"><strong>__eq__</strong></a>(...)</dt><dd><tt>x.__eq__(y) <==> x==y</tt></dd></dl> <dl><dt><a name="SimpleListWalker-__ge__"><strong>__ge__</strong></a>(...)</dt><dd><tt>x.__ge__(y) <==> x>=y</tt></dd></dl> <dl><dt><a name="SimpleListWalker-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.__getattribute__('name') <==> x.name</tt></dd></dl> <dl><dt><a name="SimpleListWalker-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.__getitem__(y) <==> x[y]</tt></dd></dl> <dl><dt><a name="SimpleListWalker-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.__getslice__(i, j) <==> x[i:j]<br> <br> Use of negative indices is not supported.</tt></dd></dl> <dl><dt><a name="SimpleListWalker-__gt__"><strong>__gt__</strong></a>(...)</dt><dd><tt>x.__gt__(y) <==> x>y</tt></dd></dl> <dl><dt><a name="SimpleListWalker-__iter__"><strong>__iter__</strong></a>(...)</dt><dd><tt>x.__iter__() <==> iter(x)</tt></dd></dl> <dl><dt><a name="SimpleListWalker-__le__"><strong>__le__</strong></a>(...)</dt><dd><tt>x.__le__(y) <==> x<=y</tt></dd></dl> <dl><dt><a name="SimpleListWalker-__len__"><strong>__len__</strong></a>(...)</dt><dd><tt>x.__len__() <==> len(x)</tt></dd></dl> <dl><dt><a name="SimpleListWalker-__lt__"><strong>__lt__</strong></a>(...)</dt><dd><tt>x.__lt__(y) <==> x<y</tt></dd></dl> <dl><dt><a name="SimpleListWalker-__mul__"><strong>__mul__</strong></a>(...)</dt><dd><tt>x.__mul__(n) <==> x*n</tt></dd></dl> <dl><dt><a name="SimpleListWalker-__ne__"><strong>__ne__</strong></a>(...)</dt><dd><tt>x.__ne__(y) <==> x!=y</tt></dd></dl> <dl><dt><a name="SimpleListWalker-__reversed__"><strong>__reversed__</strong></a>(...)</dt><dd><tt>L.__reversed__() -- return a reverse iterator over the list</tt></dd></dl> <dl><dt><a name="SimpleListWalker-count"><strong>count</strong></a>(...)</dt><dd><tt>L.count(value) -> integer -- return number of occurrences of value</tt></dd></dl> <dl><dt><a name="SimpleListWalker-index"><strong>index</strong></a>(...)</dt><dd><tt>L.index(value, [start, [stop]]) -> integer -- return first index of value</tt></dd></dl> <hr> Data and other attributes inherited from list:<br> <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object at 0x72ce20><dd><tt>T.__new__(S, ...) -> a new object with type S, a subtype of T</tt></dl> <hr> Data and other attributes inherited from ListWalker:<br> <dl><dt><strong>__metaclass__</strong> = <class 'urwid.util.MetaSignals'><dd><tt>register the list of signals in the class varable signals,<br> including signals in superclasses.</tt></dl> <dl><dt><strong>signals</strong> = ['modified']</dl> <h2>Canvas painting</h2><a name="Canvas"></a><h3>function Canvas <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="Canvas">class <strong>Canvas</strong></a>(object) <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="Canvas-__init__"><strong>__init__</strong></a>(self, value1<font color="#909090">=None</font>, value2<font color="#909090">=None</font>, value3<font color="#909090">=None</font>)</dt><dd><tt>value1, value2, value3 -- if not None, raise a helpful error:<br> the old Canvas class is now called TextCanvas.</tt></dd></dl> <dl><dt><a name="Canvas-cols"><strong>cols</strong></a>(self)</dt></dl> <dl><dt><a name="Canvas-content"><strong>content</strong></a>(self, trim_left<font color="#909090">=0</font>, trim_top<font color="#909090">=0</font>, cols<font color="#909090">=None</font>, rows<font color="#909090">=None</font>, attr<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="Canvas-content_delta"><strong>content_delta</strong></a>(self)</dt></dl> <dl><dt><a name="Canvas-finalize"><strong>finalize</strong></a>(self, widget, size, focus)</dt><dd><tt>Mark this canvas as finalized (should not be any future<br> changes to its content). This is required before caching<br> the canvas. This happens automatically after a widget's<br> render call returns the canvas thanks to some metaclass<br> magic.<br> <br> widget -- widget that rendered this canvas<br> size -- size parameter passed to widget's render method<br> focus -- focus parameter passed to widget's render method</tt></dd></dl> <dl><dt><a name="Canvas-get_cursor"><strong>get_cursor</strong></a>(self)</dt></dl> <dl><dt><a name="Canvas-rows"><strong>rows</strong></a>(self)</dt></dl> <dl><dt><a name="Canvas-set_cursor"><strong>set_cursor</strong></a>(self, c)</dt></dl> <dl><dt><a name="Canvas-translate_coords"><strong>translate_coords</strong></a>(self, dx, dy)</dt><dd><tt>Return coords shifted by (dx, dy).</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> <dl><dt><strong>attr</strong></dt> </dl> <dl><dt><strong>cs</strong></dt> </dl> <dl><dt><strong>cursor</strong></dt> </dl> <dl><dt><strong>text</strong></dt> </dl> <dl><dt><strong>widget_info</strong></dt> </dl> <a name="TextCanvas"></a><h3>function TextCanvas <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="TextCanvas">class <strong>TextCanvas</strong></a>(Canvas) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt> <dd>TextCanvas</dd> <dd>Canvas</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="TextCanvas-__init__"><strong>__init__</strong></a>(self, text<font color="#909090">=None</font>, attr<font color="#909090">=None</font>, cs<font color="#909090">=None</font>, cursor<font color="#909090">=None</font>, maxcol<font color="#909090">=None</font>, check_width<font color="#909090">=True</font>)</dt><dd><tt>text -- list of strings, one for each line<br> attr -- list of run length encoded attributes for text<br> cs -- list of run length encoded character set for text<br> cursor -- (x,y) of cursor or None<br> maxcol -- screen columns taken by this canvas<br> check_width -- check and fix width of all lines in text</tt></dd></dl> <dl><dt><a name="TextCanvas-cols"><strong>cols</strong></a>(self)</dt><dd><tt>Return the screen column width of this canvas.</tt></dd></dl> <dl><dt><a name="TextCanvas-content"><strong>content</strong></a>(self, trim_left<font color="#909090">=0</font>, trim_top<font color="#909090">=0</font>, cols<font color="#909090">=None</font>, rows<font color="#909090">=None</font>, def_attr<font color="#909090">=None</font>)</dt><dd><tt>Return the canvas content as a list of rows where each row<br> is a list of (attr, cs, text) tuples.<br> <br> trim_left, trim_top, cols, rows may be set by <br> CompositeCanvas when rendering a partially obscured<br> canvas.</tt></dd></dl> <dl><dt><a name="TextCanvas-content_delta"><strong>content_delta</strong></a>(self, other)</dt><dd><tt>Return the differences between other and this canvas.<br> <br> If other is the same object as self this will return no <br> differences, otherwise this is the same as calling <br> content().</tt></dd></dl> <dl><dt><a name="TextCanvas-rows"><strong>rows</strong></a>(self)</dt><dd><tt>Return the number of rows in this canvas.</tt></dd></dl> <dl><dt><a name="TextCanvas-translated_coords"><strong>translated_coords</strong></a>(self, dx, dy)</dt><dd><tt>Return cursor coords shifted by (dx, dy), or None if there<br> is no cursor.</tt></dd></dl> <hr> Methods inherited from Canvas:<br> <dl><dt><a name="TextCanvas-finalize"><strong>finalize</strong></a>(self, widget, size, focus)</dt><dd><tt>Mark this canvas as finalized (should not be any future<br> changes to its content). This is required before caching<br> the canvas. This happens automatically after a widget's<br> render call returns the canvas thanks to some metaclass<br> magic.<br> <br> widget -- widget that rendered this canvas<br> size -- size parameter passed to widget's render method<br> focus -- focus parameter passed to widget's render method</tt></dd></dl> <dl><dt><a name="TextCanvas-get_cursor"><strong>get_cursor</strong></a>(self)</dt></dl> <dl><dt><a name="TextCanvas-set_cursor"><strong>set_cursor</strong></a>(self, c)</dt></dl> <dl><dt><a name="TextCanvas-translate_coords"><strong>translate_coords</strong></a>(self, dx, dy)</dt><dd><tt>Return coords shifted by (dx, dy).</tt></dd></dl> <hr> Data descriptors inherited from Canvas:<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> <dl><dt><strong>attr</strong></dt> </dl> <dl><dt><strong>cs</strong></dt> </dl> <dl><dt><strong>cursor</strong></dt> </dl> <dl><dt><strong>text</strong></dt> </dl> <dl><dt><strong>widget_info</strong></dt> </dl> <a name="CompositeCanvas"></a><h3>function CompositeCanvas <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="CompositeCanvas">class <strong>CompositeCanvas</strong></a>(Canvas) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt> <dd>CompositeCanvas</dd> <dd>Canvas</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="CompositeCanvas-__init__"><strong>__init__</strong></a>(self, canv<font color="#909090">=None</font>)</dt><dd><tt>canv -- a Canvas object to wrap this CompositeCanvas around.<br> <br> if canv is a CompositeCanvas, make a copy of its contents</tt></dd></dl> <dl><dt><a name="CompositeCanvas-cols"><strong>cols</strong></a>(self)</dt></dl> <dl><dt><a name="CompositeCanvas-content"><strong>content</strong></a>(self)</dt><dd><tt>Return the canvas content as a list of rows where each row<br> is a list of (attr, cs, text) tuples.</tt></dd></dl> <dl><dt><a name="CompositeCanvas-content_delta"><strong>content_delta</strong></a>(self, other)</dt><dd><tt>Return the differences between other and this canvas.</tt></dd></dl> <dl><dt><a name="CompositeCanvas-fill_attr"><strong>fill_attr</strong></a>(self, a)</dt><dd><tt>Apply attribute a to all areas of this canvas with default<br> attribute currently set to None, leaving other attributes<br> intact.</tt></dd></dl> <dl><dt><a name="CompositeCanvas-overlay"><strong>overlay</strong></a>(self, other, left, top)</dt><dd><tt>Overlay other onto this canvas.</tt></dd></dl> <dl><dt><a name="CompositeCanvas-pad_trim_left_right"><strong>pad_trim_left_right</strong></a>(self, left, right)</dt><dd><tt>Pad or trim this canvas on the left and right<br> <br> values > 0 indicate screen columns to pad<br> values < 0 indicate screen columns to trim</tt></dd></dl> <dl><dt><a name="CompositeCanvas-pad_trim_top_bottom"><strong>pad_trim_top_bottom</strong></a>(self, top, bottom)</dt><dd><tt>Pad or trim this canvas on the top and bottom.</tt></dd></dl> <dl><dt><a name="CompositeCanvas-rows"><strong>rows</strong></a>(self)</dt></dl> <dl><dt><a name="CompositeCanvas-set_depends"><strong>set_depends</strong></a>(self, widget_list)</dt><dd><tt>Explicitly specify the list of widgets that this canvas<br> depends on. If any of these widgets change this canvas<br> will have to be updated.</tt></dd></dl> <dl><dt><a name="CompositeCanvas-trim"><strong>trim</strong></a>(self, top, count<font color="#909090">=None</font>)</dt><dd><tt>Trim lines from the top and/or bottom of canvas.<br> <br> top -- number of lines to remove from top<br> count -- number of lines to keep, or None for all the rest</tt></dd></dl> <dl><dt><a name="CompositeCanvas-trim_end"><strong>trim_end</strong></a>(self, end)</dt><dd><tt>Trim lines from the bottom of the canvas.<br> <br> end -- number of lines to remove from the end</tt></dd></dl> <hr> Methods inherited from Canvas:<br> <dl><dt><a name="CompositeCanvas-finalize"><strong>finalize</strong></a>(self, widget, size, focus)</dt><dd><tt>Mark this canvas as finalized (should not be any future<br> changes to its content). This is required before caching<br> the canvas. This happens automatically after a widget's<br> render call returns the canvas thanks to some metaclass<br> magic.<br> <br> widget -- widget that rendered this canvas<br> size -- size parameter passed to widget's render method<br> focus -- focus parameter passed to widget's render method</tt></dd></dl> <dl><dt><a name="CompositeCanvas-get_cursor"><strong>get_cursor</strong></a>(self)</dt></dl> <dl><dt><a name="CompositeCanvas-set_cursor"><strong>set_cursor</strong></a>(self, c)</dt></dl> <dl><dt><a name="CompositeCanvas-translate_coords"><strong>translate_coords</strong></a>(self, dx, dy)</dt><dd><tt>Return coords shifted by (dx, dy).</tt></dd></dl> <hr> Data descriptors inherited from Canvas:<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> <dl><dt><strong>attr</strong></dt> </dl> <dl><dt><strong>cs</strong></dt> </dl> <dl><dt><strong>cursor</strong></dt> </dl> <dl><dt><strong>text</strong></dt> </dl> <dl><dt><strong>widget_info</strong></dt> </dl> <a name="SolidCanvas"></a><h3>function SolidCanvas <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><h3><a name="SolidCanvas">class <strong>SolidCanvas</strong></a>(Canvas) <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt>Method resolution order:</dt> <dd>SolidCanvas</dd> <dd>Canvas</dd> <dd>object</dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="SolidCanvas-__init__"><strong>__init__</strong></a>(self, fill_char, cols, rows)</dt></dl> <dl><dt><a name="SolidCanvas-cols"><strong>cols</strong></a>(self)</dt></dl> <dl><dt><a name="SolidCanvas-content"><strong>content</strong></a>(self, trim_left<font color="#909090">=0</font>, trim_top<font color="#909090">=0</font>, cols<font color="#909090">=None</font>, rows<font color="#909090">=None</font>, attr<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="SolidCanvas-content_delta"><strong>content_delta</strong></a>(self, other)</dt><dd><tt>Return the differences between other and this canvas.</tt></dd></dl> <dl><dt><a name="SolidCanvas-rows"><strong>rows</strong></a>(self)</dt></dl> <hr> Methods inherited from Canvas:<br> <dl><dt><a name="SolidCanvas-finalize"><strong>finalize</strong></a>(self, widget, size, focus)</dt><dd><tt>Mark this canvas as finalized (should not be any future<br> changes to its content). This is required before caching<br> the canvas. This happens automatically after a widget's<br> render call returns the canvas thanks to some metaclass<br> magic.<br> <br> widget -- widget that rendered this canvas<br> size -- size parameter passed to widget's render method<br> focus -- focus parameter passed to widget's render method</tt></dd></dl> <dl><dt><a name="SolidCanvas-get_cursor"><strong>get_cursor</strong></a>(self)</dt></dl> <dl><dt><a name="SolidCanvas-set_cursor"><strong>set_cursor</strong></a>(self, c)</dt></dl> <dl><dt><a name="SolidCanvas-translate_coords"><strong>translate_coords</strong></a>(self, dx, dy)</dt><dd><tt>Return coords shifted by (dx, dy).</tt></dd></dl> <hr> Data descriptors inherited from Canvas:<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> <dl><dt><strong>attr</strong></dt> </dl> <dl><dt><strong>cs</strong></dt> </dl> <dl><dt><strong>cursor</strong></dt> </dl> <dl><dt><strong>text</strong></dt> </dl> <dl><dt><strong>widget_info</strong></dt> </dl> <a name="CanvasCombine"></a><h3>function CanvasCombine <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt><a name="-CanvasCombine"><strong>CanvasCombine</strong></a>(l)</dt><dd><tt>Stack canvases in l vertically and return resulting canvas.<br> <br> l -- list of (canvas, position, focus) tuples. position is a value<br> that widget.set_focus will accept, or None if not allowed.<br> focus is True if this canvas is the one that would be in focus<br> if the whole widget is in focus.</tt></dd></dl> <a name="CanvasJoin"></a><h3>function CanvasJoin <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt><a name="-CanvasJoin"><strong>CanvasJoin</strong></a>(l)</dt><dd><tt>Join canvases in l horizontally. Return result.<br> l -- list of (canvas, position, focus, cols) tuples. position is a <br> value that widget.set_focus will accept, or None if not allowed.<br> focus is True if this canvas is the one that would be in focus if<br> the whole widget is in focus. cols is the number of screen<br> columns that this widget will require, if larger than the actual<br> canvas.cols() value then this widget will be padded on the right.</tt></dd></dl> <a name="CanvasOverlay"></a><h3>function CanvasOverlay <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt><a name="-CanvasOverlay"><strong>CanvasOverlay</strong></a>(top_c, bottom_c, left, top)</dt><dd><tt>Overlay canvas top_c onto bottom_c at position (left, top).</tt></dd></dl> <h2>Custom formatting rules</h2><h3><a name="TextLayout">class <strong>TextLayout</strong></a> <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="TextLayout-layout"><strong>layout</strong></a>(self, text, width, align, wrap)</dt><dd><tt>Return a layout structure for text.<br> <br> text -- string in current encoding or unicode string<br> width -- number of screen columns available<br> align -- align mode for text<br> wrap -- wrap mode for text<br> <br> Layout structure is a list of line layouts, one per output line.<br> Line layouts are lists than may contain the following tuples:<br> ( column width of text segment, start offset, end offset )<br> ( number of space characters to insert, offset or None)<br> ( column width of insert text, offset, "insert text" )<br> <br> The offset in the last two tuples is used to determine the<br> attribute used for the inserted spaces or text respectively. <br> The attribute used will be the same as the attribute at that <br> text offset. If the offset is None when inserting spaces<br> then no attribute will be used.</tt></dd></dl> <dl><dt><a name="TextLayout-supports_align_mode"><strong>supports_align_mode</strong></a>(self, align)</dt><dd><tt>Return True if align is a supported align mode.</tt></dd></dl> <dl><dt><a name="TextLayout-supports_wrap_mode"><strong>supports_wrap_mode</strong></a>(self, wrap)</dt><dd><tt>Return True if wrap is a supported wrap mode.</tt></dd></dl> <h3><a name="StandardTextLayout">class <strong>StandardTextLayout</strong></a>(TextLayout) <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="StandardTextLayout-__init__"><strong>__init__</strong></a>(self)</dt></dl> <dl><dt><a name="StandardTextLayout-align_layout"><strong>align_layout</strong></a>(self, text, width, segs, wrap, align)</dt><dd><tt>Convert the layout segs to an aligned layout.</tt></dd></dl> <dl><dt><a name="StandardTextLayout-calculate_text_segments"><strong>calculate_text_segments</strong></a>(self, text, width, wrap)</dt><dd><tt>Calculate the segments of text to display given width screen <br> columns to display them. <br> <br> text - text to display<br> width - number of available screen columns<br> wrap - wrapping mode used<br> <br> Returns a layout structure without aligmnent applied.</tt></dd></dl> <dl><dt><a name="StandardTextLayout-layout"><strong>layout</strong></a>(self, text, width, align, wrap)</dt><dd><tt>Return a layout structure for text.</tt></dd></dl> <dl><dt><a name="StandardTextLayout-pack"><strong>pack</strong></a>(self, maxcol, layout)</dt><dd><tt>Return a minimal maxcol value that would result in the same<br> number of lines for layout. layout must be a layout structure<br> returned by layout().</tt></dd></dl> <dl><dt><a name="StandardTextLayout-supports_align_mode"><strong>supports_align_mode</strong></a>(self, align)</dt><dd><tt>Return True if align is 'left', 'center' or 'right'.</tt></dd></dl> <dl><dt><a name="StandardTextLayout-supports_wrap_mode"><strong>supports_wrap_mode</strong></a>(self, wrap)</dt><dd><tt>Return True if wrap is 'any', 'space' or 'clip'.</tt></dd></dl> <h2>Character encoding</h2><a name="set_encoding"></a><h3>function set_encoding <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt><a name="-set_encoding"><strong>set_encoding</strong></a>(encoding)</dt><dd><tt>Set the byte encoding to assume when processing strings and the<br> encoding to use when converting unicode strings.</tt></dd></dl> <a name="get_encoding_mode"></a><h3>function get_encoding_mode <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt><a name="-get_encoding_mode"><strong>get_encoding_mode</strong></a>()</dt><dd><tt>Get the mode Urwid is using when processing text strings.<br> Returns 'narrow' for 8-bit encodings, 'wide' for CJK encodings<br> or 'utf8' for UTF-8 encodings.</tt></dd></dl> <a name="supports_unicode"></a><h3>function supports_unicode <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt><a name="-supports_unicode"><strong>supports_unicode</strong></a>()</dt><dd><tt>Return True if python is able to convert non-ascii unicode strings<br> to the current encoding.</tt></dd></dl> <h2>Screen capture</h2><a name="html_fragment.screenshot_init"></a><h3>function html_fragment.screenshot_init <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt><a name="-html_fragment.screenshot_init"><strong>html_fragment.screenshot_init</strong></a> = screenshot_init(sizes, keys)</dt><dd><tt>Replace curses_display.Screen and raw_display.Screen class with <br> HtmlGenerator.<br> <br> Call this function before executing an application that uses <br> curses_display.Screen to have that code use HtmlGenerator instead.<br> <br> sizes -- list of ( columns, rows ) tuples to be returned by each call<br> to HtmlGenerator.get_cols_rows()<br> keys -- list of lists of keys to be returned by each call to<br> HtmlGenerator.get_input()<br> <br> Lists of keys may include "window resize" to force the application to<br> call get_cols_rows and read a new screen size.<br> <br> For example, the following call will prepare an application to:<br> 1. start in 80x25 with its first call to get_cols_rows()<br> 2. take a screenshot when it calls draw_screen(..)<br> 3. simulate 5 "down" keys from get_input()<br> 4. take a screenshot when it calls draw_screen(..)<br> 5. simulate keys "a", "b", "c" and a "window resize"<br> 6. resize to 20x10 on its second call to get_cols_rows()<br> 7. take a screenshot when it calls draw_screen(..)<br> 8. simulate a "Q" keypress to quit the application<br> <br> screenshot_init( [ (80,25), (20,10) ],<br> [ ["down"]*5, ["a","b","c","window resize"], ["Q"] ] )</tt></dd></dl> <a name="html_fragment.screenshot_collect"></a><h3>function html_fragment.screenshot_collect <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt><a name="-html_fragment.screenshot_collect"><strong>html_fragment.screenshot_collect</strong></a> = screenshot_collect()</dt><dd><tt>Return screenshots as a list of HTML fragments.</tt></dd></dl> <h3><a name="html_fragment.HtmlGenerator"></a><strong>html_fragment.HtmlGenerator</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="HtmlGenerator-__init__"><strong>__init__</strong></a>(self)</dt></dl> <dl><dt><a name="HtmlGenerator-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 html_fragment)</tt></dd></dl> <dl><dt><a name="HtmlGenerator-draw_screen"><strong>draw_screen</strong></a>(self, (cols, rows), r)</dt><dd><tt>Create an html fragment from the render object. <br> Append it to HtmlGenerator.fragments list.</tt></dd></dl> <dl><dt><a name="HtmlGenerator-get_cols_rows"><strong>get_cols_rows</strong></a>(self)</dt><dd><tt>Return the next screen size in HtmlGenerator.sizes.</tt></dd></dl> <dl><dt><a name="HtmlGenerator-get_input"><strong>get_input</strong></a>(self)</dt><dd><tt>Return the next list of keypresses in HtmlGenerator.keys.</tt></dd></dl> <dl><dt><a name="HtmlGenerator-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="HtmlGenerator-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="HtmlGenerator-run_wrapper"><strong>run_wrapper</strong></a>(self, fn)</dt><dd><tt>Call fn.</tt></dd></dl> <dl><dt><a name="HtmlGenerator-set_mouse_tracking"><strong>set_mouse_tracking</strong></a>(self)</dt><dd><tt>Not yet implemented</tt></dd></dl> <dl><dt><a name="HtmlGenerator-start"><strong>start</strong></a>(self)</dt></dl> <dl><dt><a name="HtmlGenerator-stop"><strong>stop</strong></a>(self)</dt></dl> <hr> Data and other attributes defined here:<br> <dl><dt><strong>fragments</strong> = []</dl> <dl><dt><strong>keys</strong> = []</dl> <dl><dt><strong>sizes</strong> = []</dl> <h2>Web Application Interface</h2><a name="web_display.is_web_request"></a><h3>function web_display.is_web_request <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt><a name="-web_display.is_web_request"><strong>web_display.is_web_request</strong></a> = is_web_request()</dt><dd><tt>Return True if this is a CGI web request.</tt></dd></dl> <a name="web_display.set_preferences"></a><h3>function web_display.set_preferences <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt><a name="-web_display.set_preferences"><strong>web_display.set_preferences</strong></a> = set_preferences(app_name, pipe_dir<font color="#909090">='/tmp'</font>, allow_polling<font color="#909090">=True</font>, max_clients<font color="#909090">=20</font>)</dt><dd><tt>Set web_display preferences.<br> <br> app_name -- application name to appear in html interface<br> pipe_dir -- directory for input pipes, daemon update sockets <br> and daemon error logs<br> allow_polling -- allow creation of daemon processes for <br> browsers without multipart support <br> max_clients -- maximum concurrent client connections. This<br> pool is shared by all urwid applications<br> using the same pipe_dir</tt></dd></dl> <a name="web_display.handle_short_request"></a><h3>function web_display.handle_short_request <span style="font-size:small; padding-left: 20px">[<a href="#top">back to top</a>]</span></h3><dl><dt><a name="-web_display.handle_short_request"><strong>web_display.handle_short_request</strong></a> = handle_short_request()</dt><dd><tt>Handle short requests such as passing keystrokes to the application<br> or sending the initial html page. If returns True, then this<br> function recognised and handled a short request, and the calling<br> script should immediately exit.<br> <br> web_display.set_preferences(..) should be called before calling this<br> function for the preferences to take effect</tt></dd></dl> </body> </html>