, disabled, , Mac, , , . Mac . disabled, <ButtonPress-1>, , , .
... , , . " , ". , . , , , , .
, insert delete: - , , . . , .
, , Tcl , insert delete . , Tkinter, tcl-, , tcl-, Python.
, , , , .
, , . , , , :
import Tkinter as tk
class SampleApp(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
self.text = tk.Text(width=40, height=20)
self.text.bind("<1>", self.set_focus)
self.text.insert("end", "\n".join(dir(tk.Tk)))
self.text.configure(state="disabled")
self.text.pack(fill="both", expand=True)
def set_focus(self, event):
'''Explicitly set focus, so user can select and copy text'''
self.text.focus_set()
if __name__ == "__main__":
app = SampleApp()
app.mainloop()