本文整理汇总了Python中model.Entry.getEntry方法的典型用法代码示例。如果您正苦于以下问题:Python Entry.getEntry方法的具体用法?Python Entry.getEntry怎么用?Python Entry.getEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.Entry
的用法示例。
在下文中一共展示了Entry.getEntry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from model import Entry [as 别名]
# 或者: from model.Entry import getEntry [as 别名]
def __init__(self, master):
self.currDate = datetime.date.today()
self.createMenu(master)
self.createStatusBar(master)
frame_top = tkinter.Frame(master)
frame_top.pack(side=tkinter.TOP)
frame_left = tkinter.Frame(master)
frame_left.pack(side=tkinter.LEFT)
frame_right = tkinter.Frame(master)
frame_right.pack()
# create date label
self.dateLabel = tkinter.Label(
frame_top, text="Date: " + str(self.currDate))
self.dateLabel.pack()
# create entry widget for storing diary entry
self.entry = tkinter.Text(
frame_left, wrap=tkinter.WORD, width=100, height=50)
# get text for currDate if exists
entryText = Entry.getEntry(self.currDate)
if entryText:
self.entry.insert(1.0, entryText)
self.entry.pack(padx=10, pady=10, fill=tkinter.BOTH)
#create next and previous entry buttons
self.previousEntryButton = tkinter.Button(
frame_right, text="prev", command=self.prevEntry)
self.nextEntryButton = tkinter.Button(
frame_right, text="next", command=self.nextEntry)
self.previousEntryButton.pack()
self.nextEntryButton.pack()
# create a save entry button
self.saveEntryButton = tkinter.Button(
frame_right, text="Save", command=self.saveEntry)
self.saveEntryButton.pack()
# create a delete entry button
self.deleteEntryButton = tkinter.Button(
frame_right, text="Delete", command=self.deleteEntry)
self.deleteEntryButton.pack()
示例2: getEntry
# 需要导入模块: from model import Entry [as 别名]
# 或者: from model.Entry import getEntry [as 别名]
def getEntry(self, date):
"""
Gets the contents of an entry of a specified date
"""
return Entry.getEntry(date)