Web Analytics Made Easy - Statcounter
Skip to content

Multiline

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,
    k = None,
    write_only = False,
    focus = False,
    font = None,
    pad = None,
    tooltip = None,
    visible = True,
    size_px = (None, None),
    metadata = 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
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, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
k str or int or tuple or object None Same as the Key. You can use either k or key. Which ever is set will be used.
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
metadata Any None User metadata that can be set to ANYTHING
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. If an int instead of a tuple is supplied, then height is auto-set to 1
size_px (int, int) or (None, None) (None, None) w=pixels-wide, h=pixels-high
text_color str None color of the text
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 expand
 def get
 def get_stylesheet
 def print
 def set_focus
 def set_stylesheet
 def update

expand

WARNING - NOT USED IN PySimpleGUIQt port. Provided as dummy method

expand(
    expand_x = False,
    expand_y = False,
    expand_row = True
)

Parameter Descriptions

Name Type Default Description
expand_row bool True If True the row containing the element will also expand. Without this your element is "trapped" within the row
expand_x bool False If True Element will expand in the Horizontal directions
expand_y bool False If True Element will expand in the Vertical directions
RETURN None None

get

Gets the elements value

get()

get_stylesheet

Returns the stylesheet for element's associated Qt Widget

get_stylesheet()

Parameter Descriptions

Name Type Default Description
RETURN str stylesheet

print

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

colors -(str, str) or str. A combined text/background color definition in a single parameter

There are also "aliases" for text_color, background_color and colors (t, b, c) t - An alias for color of the text (makes for shorter calls) b - An alias for the background_color parameter c - (str, str) - "shorthand" way of specifying color. (foreground, backgrouned) c - str - can also be a string of the format "foreground on background" ("white on red")

With the aliases it's possible to write the same print but in more compact ways: cprint('This will print white text on red background', c=('white', 'red')) cprint('This will print white text on red background', c='white on red') cprint('This will print white text on red background', text_color='white', background_color='red') cprint('This will print white text on red background', t='white', b='red')

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

Parameter Descriptions

Name Type Default Description
args Any The arguments to print
autoscroll bool True If True the contents of the element will automatically scroll as more data added to the end
background_color str None The background color of the line
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 The color of the text

set_focus

Sets the current focus to be on this element

set_focus()

set_stylesheet

Sets the stylesheet for a Qt Widget

set_stylesheet(
    stylesheet
)

Parameter Descriptions

Name Type Default Description
stylesheet str Stylesheet (string) to set stylesheet to

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,
    autoscroll = False,
    background_color = None,
    text_color = None,
    font = None,
    text_color_for_value = None,
    background_color_for_value = None,
    visible = None,
    readonly = 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 False if True then contents of element are scrolled down when new text is added to the end
background_color str None color of background. Can be in #RRGGBB format or a color name "black"
background_color_for_value str None color of the new background of the text being added (the value paramter)
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
readonly bool None make element readonly (user can't change). True means user cannot change
text_color str None element's text color. Can be in #RRGGBB format or a color name "black"
text_color_for_value str None color of the new text being added (the value paramter)
value Any None new text to display
visible bool None set visibility state of the element