简体   繁体   English

PyGTK标签设置光标功能?

[英]PyGTK label set cursor function?

I have a selectable gtk.label, and I would like to have the cursor in the label when the program starts. 我有一个可选的gtk.label,我想在程序启动时将光标放在标签中。 Is there a function that I can use to do this? 有可以用来执行此操作的功能吗?

I don't know if it's possible, but if it is, then 我不知道是否可能,但是如果可以,那么

label.grab_focus()

will do it. 会做的。 Make sure to set the gtk.CAN_FOCUS flag first. 确保首先设置gtk.CAN_FOCUS标志。 Documentation here. 这里的文档。

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

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