CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

CTkTextbox not readable in disable state

Open Mirjax2000 opened this issue 1 year ago • 6 comments

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.

Mirjax2000 avatar Aug 31 '24 13:08 Mirjax2000

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

Regards.

dipeshSam avatar Aug 31 '24 13:08 dipeshSam

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

Mirjax2000 avatar Aug 31 '24 13:08 Mirjax2000

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()

    

dipeshSam avatar Aug 31 '24 14:08 dipeshSam

ahh i see, Thank you wizzard

Mirjax2000 avatar Aug 31 '24 14:08 Mirjax2000

You are most welcome, brother. 😊

Regards.

dipeshSam avatar Aug 31 '24 14:08 dipeshSam

disabled

ohh ty. it's useful for me.

qffylqwq avatar Nov 23 '24 02:11 qffylqwq