簡體   English   中英

在tkinter文本小部件中設置插入字符的位置

[英]Setting the position of the insert character in the tkinter text widget

我想在tkinter文本小部件中更改插入字符的位置。 有沒有一種方法或任何其他方式可以幫助我設置文本小部件中插入字符的位置?

您可以將mark_set方法insert標記一起使用。

例如:

t.mark_set('insert', '2.3')

要么

t.mark_set(INSERT, '2.3')

上面的代碼將光標定位在第二行的第三個字符之后。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM