看起來,語句:MyText.mark_set(INSERT, 'new index')
修改了Text .insert()方法的插入位置,但不修改鍵盤上鍵入的文本的插入位置。在文本部件中移動插入位置
在其他的方式,有沒有辦法使用.insert()這樣的方法來插入CTRL-END鍵相當於
from tkinter import *
def curseur(bidon):
mytext.mark_set(INSERT, END)
root = Tk()
mytext = Text(root)
mytext.pack()
mytext.insert(INSERT, "Clic in other window, then clic back here (line one)\n")
mytext.insert(INSERT, "Type something on the keyboard\n")
mytext.insert(INSERT, "The typed text must go to the end of the widget\n")
mytext.bind("<FocusIn>", curseur)
root.mainloop()
謝謝
實際上它應該移動光標。你能顯示你的代碼嗎? – Junuxx 2013-02-27 17:31:20