python GTK条目:当条目为空时,光标向左

问题描述

我正在使用Gtk.Entry并从左向右书写(xalign == 0.0)。 当条目不为空时,光标将位于文本的右侧(如预期的那样): enter image description here 但是,如果该条目为空,则光标在右侧: enter image description here

这就是我创建条目的方式:

def createuserEntry(self):
    self.user_entry = Gtk.Entry()
    self.user_entry.set_width_chars(10)
    user_label = Gtk.Label(label="User:")
    self.user_entry.set_text(self.args.user)
    self.user_entry.connect('activate',self.ActivateUserTextBox)
    user_Box = Gtk.HBox()
    user_Box.pack_start(user_label,expand=False,fill=False,padding=10)
    user_Box.pack_start(self.user_entry,padding=0)
    return user_Box


def ActivateUserTextBox(self,widget):
    new_user = widget.get_text().strip()
    self.args.user = new_user

我该如何解决? 谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)