首页 > 解决方案 > PySimpleGUI,sg.Output 不可更改

问题描述

如何使输出为只读,而不能删除或更改其中的文本?

class TelaLogin:
    def __init__(self):

        layout= [
            [sg.Image(data=bordacima, key='__IMAGE3__')],
            [sg.Image(data=emailimg, pad=(301,0), key='__IMAGE8__')],
            [sg.Input(justification='left', pad=(343, 0), size=(25, 0))],
            [sg.Text('')],
            [sg.Image(data=senhaimg, pad=(301,0), key='__IMAGE7__')],
            [sg.Input(justification='left', password_char=('*'), size=(25, 0), pad=(343, 0))],
            [sg.Button('', image_data=conectar1, button_color=('black', 'black'), pad=(383, 7))],
            ***[sg.Output(size=(40, 4), pad=(281, 4))],***
        ]

        self.janela = sg.Window('UniquePT').layout(layout)
        
        

    def Conectar(self):
        while True:
            self.button, self.values = self.janela.Read()
            print(f'Conectando...')
            GAME = login(self)
            print(f'')
            print(f'')

标签: pythonoutputpysimplegui

解决方案


推荐阅读