本文整理汇总了Python中tkinter.Entry.unbind方法的典型用法代码示例。如果您正苦于以下问题:Python Entry.unbind方法的具体用法?Python Entry.unbind怎么用?Python Entry.unbind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.Entry
的用法示例。
在下文中一共展示了Entry.unbind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Example
# 需要导入模块: from tkinter import Entry [as 别名]
# 或者: from tkinter.Entry import unbind [as 别名]
#.........这里部分代码省略.........
else:
self.labelErrorPointer.grid_forget()
print('Attempting login for ' + username)
try:
self.USERAGENT = username + ' practices Tkinter+PRAW mixing with utility by /u/GoldenSights.'
self.r = praw.Reddit(self.USERAGENT)
#self.r.login(username, password)
print('Success')
self.labelU.grid_forget()
self.labelP.grid_forget()
self.entryUsername.grid_forget()
self.entryPassword.grid_forget()
self.newbutton.grid_forget()
self.quitbutton.grid_forget()
self.usernamelabel = Label(self, text=username + ', Sending to /u/' + self.mailrecipient)
self.usernamelabel.grid(row=0, column=0, columnspan=8)
self.quitbutton.grid(row=900, column=0)
self.labellist = []
self.entrylist = []
self.verifylist = []
self.misclist = []
self.optionDiscuss = "Discussion Flair + Crossposting"
self.optionRegister = "Register a new Candidate"
self.prevmode = self.optionDiscuss
self.curmode = self.optionDiscuss
self.optionvar = tkinter.StringVar(self)
self.optionvar.trace("w",self.permaloop)
self.optionvar.set(self.optionDiscuss)
self.option = OptionMenu(self, self.optionvar, self.optionDiscuss, self.optionRegister, "three", "four")
self.newbutton.unbind("<Return>")
self.entryUsername.unbind("<Return>")
self.entryPassword.unbind("<Return>")
self.option.grid(row=1,column=0,columnspan=8,pady=8)
self.updategui(True)
except praw.errors.InvalidUserPass:
pass
print('Invalid username or password')
self.entryPassword.delete(0,200)
self.labelErrorPointer.grid(row=1, column=2)
def permaloop(self, *args):
self.curmode = self.optionvar.get()
print('Was: ' + self.prevmode + ' | Now: ' + self.curmode)
if self.curmode != self.prevmode:
self.prevmode = self.curmode
self.updategui(True)
def updategui(self, *args):
if args[0] == True:
print('Cleaning GUI')
for item in self.labellist:
item.grid_forget()
for item in self.entrylist:
item.grid_forget()
for item in self.verifylist:
item.grid_forget()
for item in self.misclist:
item.grid_forget()
self.labellist = []
self.entrylist = []
self.verifylist = []
self.misclist = []