当前位置: 首页>>代码示例>>Python>>正文


Python Frame.mainloop方法代码示例

本文整理汇总了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()
开发者ID:brandonPauly,项目名称:pythonToys,代码行数:9,代码来源:clicks.py

示例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()
开发者ID:LaoQi,项目名称:pngTexturePacker,代码行数:32,代码来源:main.py


注:本文中的tkinter.Frame.mainloop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。