1

Есть текст в Ladel.

import tkinter as tk

root = tk.Tk()
label = tk.Label(root, text='LABEL')
label.grid()

root.mainloop()

Как сделать, чтобы можно было его выделить для последующего копирования в буфер обмена?

1 ответ 1

2

Проще всего эмулировать с помощью Entry

import tkinter as tk

root = tk.Tk()

label = tk.Label(root, text='Test')
label.pack()

s = tk.StringVar()
s.set('Test')
entry = tk.Entry(root, text=s, state='readonly', justify='center', bd=0)
entry.pack()

root.mainloop()

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.