例如:
from Tkinter import *
root = Tk()
e1 = Entry(root)
e1.insert(END, "ex. new file") #would like to make this text disappear when clicked
e1.grid(row=0, column=0)
root.mainloop()
单击时,文本“ex.newfile”消失,留下一个空白的输入字段。
答案 0 :(得分:1)
@vip_users = User.where(role: 'vip')
@admin_users = User.where(role: 'admin')
,<% @vip_users.each do |user| %>
# Create your table with vip users here
<% end %>
<% @admin_users.each do |user| %>
# Create your table with admin users here
<% end %>
。答案 1 :(得分:0)
加
def delete_text(event):
if default_text:
e1.delete(0, END)
default_text = False
default_text = True
e1.bind("<Button-1>", delete_text)
感谢DYZ和effbot