代码拉取完成,页面将自动刷新
同步操作将从 cheney/tkinter界面展示 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import tkinter as tk
import time
import logging, logg
import tkinter.ttk as ttk
# Useful third party website
# https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/frame.html
# https://tkdocs.com/tutorial/widgets.html
# https://www.tutorialspoint.com/python3/python_gui_programming.htm
# current file logger
cf_logger = logging.getLogger('Tk_widgets_sample.universal_functions')
def universal_function():
# https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/universal.html
# details refer to above links
# common use the bind function
# get master
master = tk.Tk()
style = ttk.Style()
# gloabal default style
style.configure('.', font='Arial 19', foreground='yellow', background='red')
# custom style
style.configure('mystyle.TButton', font='Arial 15', foreground='blue', padding=10)
# buttons
btn1 = ttk.Button(master, text='Im using default gloable style')
btn1.pack()
btn2 = ttk.Button(master, text='Im using mystyle', style='mystyle.TButton')
btn2.pack()
#bind
master.bind("<Button-3>", right_click) # right click with mouse
master.bind("<KeyPress-F2>", press_F2)# press F2
master.mainloop()
def right_click(event):
cf_logger.info('right click with bind function.{}'.format(event))
def press_F2(event):
cf_logger.info('F2 press with bind function. {}'.format(event))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。