本文整理汇总了Python中tkinter.Frame.mainloop方法的典型用法代码示例。如果您正苦于以下问题:Python Frame.mainloop方法的具体用法?Python Frame.mainloop怎么用?Python Frame.mainloop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.Frame
的用法示例。
在下文中一共展示了Frame.mainloop方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeWindow
# 需要导入模块: from tkinter import Frame [as 别名]
# 或者: from tkinter.Frame import mainloop [as 别名]
def makeWindow():
'create GUI'
frame = Frame(width=100, height=100, background = "blue")
frame.bind("<Button-1>", handler)
frame.bind('<Button-3>', handler2)
frame.pack()
frame.mainloop()
示例2: Button
# 需要导入模块: from tkinter import Frame [as 别名]
# 或者: from tkinter.Frame import mainloop [as 别名]
# label.pack(fill=BOTH)
top.pack()
advancedFrame.pack(anchor = "nw", pady = 20)
getBtn = Button(top, text = "打开", command = getfilepath, width = 10)
outBtn = Button(top, text = "输出目录", command = outfilepath, width = 10)
analyseBtn = Button(top, text = "开始", command = go, width = 10)
customNameLabel = Label(advancedFrame, text = "自定义名称 : ", width = 10)
customNameLabel.propagate(False)
customNameLabel.pack(anchor = "nw", side = "left")
outNameEntry.pack(anchor = "ne", side = "left")
cutlimitLabel = Label(advancedFrame, text = "大小限制 : ")
cutlimitLabel.pack(anchor = "nw", side = "left")
limitXEntry.pack(anchor = "ne", side = "left")
Label(advancedFrame, text="X", width = 2).pack(anchor = "ne", side = "left")
limitYEntry.pack(anchor = "nw", side = "left")
filePathLabel.grid(row = 0, column = 0)
getBtn.grid(row = 0, column = 1)
outDictoryLabel.grid(row = 1, column = 0)
outBtn.grid(row = 1, column = 1)
analyseBtn.grid(row = 3, column = 1)
bar.grid(row = 3, column = 0)
top.mainloop()
# if __name__ == "__main__":
# main()