本文整理匯總了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)