TomSchimansky / CustomTkinter

A modern and customizable python UI-library based on Tkinter
MIT License
11.62k stars 1.09k forks source link

CTkTextbox not readable in disable state #2562

Open Mirjax2000 opened 2 months ago

Mirjax2000 commented 2 months ago

Hi, textbox doesnt show anything when in disable state, "normal" (standard) or "disabled" (not clickable, read-only)

it shoud be read only, but its disabled completly.

dipeshSam commented 2 months ago

It is not the case. Could you please demonstrate it?

Regards.

Mirjax2000 commented 2 months ago
self.text_left_frame = ctk.CTkTextbox(
            self,
            font=font_small,
            text_color="#79c3ff",
            border_spacing=5,
        )

enabled

  self.text_left_frame = ctk.CTkTextbox(
            self,
            font=font_small,
            text_color="#79c3ff",
            border_spacing=5,
            state="disabled",
        )

disabled

dipeshSam commented 2 months ago

Don't pass the state "disabled" in constructor, if you do so, you will have needed to update or configure it back to the normal again. Instead, you may try the following way where we disable the Textbox only after successful insertion of the text.


from tkinter import Tk
from customtkinter import CTkTextbox

if __name__ == "__main__":
    app = Tk()

    tb = CTkTextbox(app)
    tb.pack(padx=50, pady=50)

    tb.insert("1.0", "Hello! How are you?")

    tb.configure(state="disabled")

    app.mainloop()
Mirjax2000 commented 2 months ago

ahh i see, Thank you wizzard

dipeshSam commented 2 months ago

You are most welcome, brother. 😊

Regards.

qffylqwq commented 3 days ago
disabled

ohh ty. it's useful for me.