Web Analytics Made Easy - Statcounter
Skip to content

Multiline

Multiline Element - Display and/or read multiple lines of text. This is an input element.

Multiline(
    default_text = "",
    enter_submits = False,
    disabled = False,
    autoscroll = False,
    size = (None, None),
    auto_size_text = None,
    background_color = None,
    text_color = None,
    change_submits = False,
    enable_events = False,
    do_not_clear = True,
    key = None,
    write_only = False,
    focus = False,
    font = None,
    pad = None,
    tooltip = None,
    visible = True,
    size_px = (None, None)
)

Parameter Descriptions

Name Type Default Description
auto_size_text bool None if True will size the element to match the length of the text
autoscroll bool False If True the contents of the element will automatically scroll as more data added to the end
background_color str None color of background. Can be in #RRGGBB format or a color name "black"
change_submits bool False DO NOT USE. Only listed for backwards compat - Use enable_events instead
default_text Any Initial text to show
disabled bool False set disable state
do_not_clear bool True if False the element will be cleared any time the Window.Read call returns
enable_events bool False Turns on the element specific events. Spin events happen when an item changes
enter_submits bool False if True, the Window.Read call will return is enter key is pressed in this element
focus bool False if True initial focus will go to this element
font (str or (str, int[, str]) or None) None specifies the font family, size. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
key str or int or tuple or object None Used with window.find_element and with return values to uniquely identify this element to uniquely identify this element
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
size (int, int) or (None, None) (None, None) (w, h) w=characters-wide, h=rows-high
size_px (int, int) or (None, None) (None, None) w=pixels-wide, h=pixels-high
text_color str None element's text color. Can be in #RRGGBB format or a color name "black"
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set visibility state of the element
write_only bool False If True then no entry will be added to the values dictionary when the window is read

Class Properties

This class has no public properties

Class Methods

 def print
 def update

print

Print like Python normally prints except route the output to a multline element and also add colors if desired

print(
    args = *<1 or N objects>,
    end = None,
    sep = None,
    text_color = None,
    background_color = None
)

Parameter Descriptions

Name Type Default Description
args Any The arguments to print
background_color str None color of background. Can be in #RRGGBB format or a color name "black"
end str None The end char to use just like print uses
sep str None The separation character like print uses
text_color str None element's text color. Can be in #RRGGBB format or a color name "black"

update

Changes some of the settings for the Multiline Element. Must call Window.Read or Window.Finalize prior.

Changes will not be visible in your window until you call window.read or window.refresh.

If you change visibility, your element may MOVE.

update(
    value = None,
    disabled = None,
    append = False,
    background_color = None,
    text_color = None,
    font = None,
    visible = None,
    autoscroll = None
)

Parameter Descriptions

Name Type Default Description
append bool False if True then new value will be added onto the end of the current value. if False then contents will be replaced.
autoscroll bool None If True the contents of the element will automatically scroll as more data added to the end
background_color str None color of background. Can be in #RRGGBB format or a color name "black"
disabled bool None disable or enable state of the element
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike for the entire element
text_color str None element's text color. Can be in #RRGGBB format or a color name "black"
value Any None new text to display
visible bool None set visibility state of the element