简体   繁体   English

在 Gtk.Entry 的末尾设置 cursor

[英]Set cursor at end of Gtk.Entry

In gtk3, I'm setting the text of an Entry, but the cursor remains at the front (position 0) of the Entry, and I'd like to move the cursor to the end.在gtk3中,我设置了一个Entry的文本,但是cursor仍然在Entry的前面(位置0),我想把cursor移到最后。 Is there a way for me to do that?我有办法做到这一点吗?

my_entry.buffer.set_text my_text, my_text.length
# ...now the cursor is at the start of the entry

A GtkEntry implements GtkEditable .一个GtkEntry实现GtkEditable So you can use gtk_editable_set_position(editable, -1)所以你可以使用gtk_editable_set_position(editable, -1)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM