Python Gtk.Entry占位符文本 [英] Python Gtk.Entry placeholder text

查看:284
本文介绍了Python Gtk.Entry占位符文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含两个gtk.Entry对象的登录窗口,一个用于用户名,一个用于密码。如何在条目中添加一些Ghosttext,因此在条目中会写入用户名,但是如果您在文本消失内部单击。

解决方案

从Gtk + 3.2开始,可以

  entry = Gtk.Entry()
entry.set_placeholder_text(我是一个占位符)


i have a login-window with two gtk.Entry objects, one for username, one for password. How can i add some Ghosttext to the Entry, so there is written "Username" in the Entry but if you click inside the text dissapears.

Starting with Gtk+ 3.2 it's possible to set placeholder text.

entry = Gtk.Entry()
entry.set_placeholder_text("I am a placeholder")

这篇关于Python Gtk.Entry占位符文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆