kerimabdullah 0 Newbie Poster

#hi friends
#when I try to press Control-a the characters in the text box are not selected
# I want help but I dont know class type programming. My codes are below.

from Tkinter import *

root = Tk()
    
def tcopy(event):
	mytextbox.clipboard_clear()
	mytextbox = text.get("sel.first", "sel.last")
	mytextbox.clipboard_append(Textkut)
def tcut(event):
    mytextbox.tcopy
    mytextbox.delete("sel.first", "sel.last")
def tpaste(event):
    mytextbox = mytextbox.selection_get(selection='CLIPBOARD')
    mytextbox.insert('insert', text)
def tselect(event):
	mytextbox.selection(1.0, end)

	
mytextbox=Text(root,exportselection=1,selectbackground="orange")

for i in range(10):
	mytextbox.insert(END,"Line Line Line\n")
	
mytextbox.bind('<Control-c>', tcopy)
mytextbox.bind('<Control-x>', tcut)
mytextbox.bind('<Control-v>', tpaste)
#mytextbox.bind('<Control-a>', tselect)

mytextbox.pack(fill='both', expand=1)

root.mainloop()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.