Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
471 B
6
Indexable
Never


class Textbox(CTkTextbox):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs, border_width=2)

    def clear(self):
        super().configure(state='normal')
        super().delete("0.0", "end") 
        super().configure(state='disabled')
    
    def clear2(self):
        self.configure(state='normal')  # enable writing
        self.delete("0.0", "end")  # delete all text
        self.configure(state='disabled') # make it read-only
Leave a Comment