MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / update

Method update

PySimpleGUI/PySimpleGUI.py:3780–3922  ·  view source on GitHub ↗

Changes some of the settings for the Multiline Element. Must call `Window.read` or set finalize=True when creating window. Changes will not be visible in your window until you call window.read or window.refresh. If you change visibility, your element may MOVE. If you want

(self, value=None, disabled=None, append=False, font=None, text_color=None, background_color=None, text_color_for_value=None,
               background_color_for_value=None, visible=None, autoscroll=None, justification=None, font_for_value=None, image=None, image_subsample=None)

Source from the content-addressed store, hash-verified

3778 return
3779
3780 def update(self, value=None, disabled=None, append=False, font=None, text_color=None, background_color=None, text_color_for_value=None,
3781 background_color_for_value=None, visible=None, autoscroll=None, justification=None, font_for_value=None, image=None, image_subsample=None):
3782 """
3783 Changes some of the settings for the Multiline Element. Must call `Window.read` or set finalize=True when creating window.
3784
3785 Changes will not be visible in your window until you call window.read or window.refresh.
3786
3787 If you change visibility, your element may MOVE. If you want it to remain stationary, use the "layout helper"
3788 function "pin" to ensure your element is "pinned" to that location in your layout so that it returns there
3789 when made visible.
3790
3791 :param value: new text to display
3792 :type value: (Any)
3793 :param disabled: disable or enable state of the element
3794 :type disabled: (bool)
3795 :param append: if True then new value will be added onto the end of the current value. if False then contents will be replaced.
3796 :type append: (bool)
3797 :param font: 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
3798 :type font: (str or (str, int[, str]) or None)
3799 :param text_color: color of the text
3800 :type text_color: (str)
3801 :param background_color: color of background
3802 :type background_color: (str)
3803 :param text_color_for_value: color of the new text being added (the value paramter)
3804 :type text_color_for_value: (str)
3805 :param background_color_for_value: color of the new background of the text being added (the value paramter)
3806 :type background_color_for_value: (str)
3807 :param visible: set visibility state of the element
3808 :type visible: (bool)
3809 :param autoscroll: if True then contents of element are scrolled down when new text is added to the end
3810 :type autoscroll: (bool)
3811 :param justification: text justification. left, right, center. Can use single characters l, r, c. Sets only for this value, not entire element
3812 :type justification: (str)
3813 :param font_for_value: specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike for the value being updated
3814 :type font_for_value: str | (str, int)
3815 :param image: Insert this image inline with text. Can be Raw or Base64 representation of the image or filename of image
3816 :type image: (str | bytes)
3817 :param image_subsample: amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc
3818 :type image_subsample: (int)
3819 """
3820
3821 if not self._widget_was_created(): # if widget hasn't been created yet, then don't allow
3822 return
3823
3824 if self._this_elements_window_closed():
3825 # _error_popup_with_traceback('Error in Multiline.update - The window was closed')
3826 return
3827
3828 if autoscroll is not None:
3829 self.Autoscroll = autoscroll
3830 current_scroll_position = self.TKText.yview()[1]
3831
3832 if justification is not None:
3833 if justification.startswith('l'):
3834 just_tag = 'left'
3835 if justification.startswith('r'):
3836 just_tag = 'right'
3837 if justification.startswith('c'):

Callers 1

writeMethod · 0.95

Calls 7

_widget_was_createdMethod · 0.80
insertMethod · 0.80
refreshMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected