本文整理汇总了Python中tkinter.Tk.report_callback_exception方法的典型用法代码示例。如果您正苦于以下问题:Python Tk.report_callback_exception方法的具体用法?Python Tk.report_callback_exception怎么用?Python Tk.report_callback_exception使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.Tk
的用法示例。
在下文中一共展示了Tk.report_callback_exception方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import report_callback_exception [as 别名]
def main():
''' Runs main application GUI.
'''
logger = get_logger()
logger.info('pyDEA started as a GUI application.')
root = Tk()
root.report_callback_exception = show_error
# load logo
if "nt" == os.name:
iconfile = pkg_resources.resource_filename(PACKAGE, 'pyDEAlogo.ico')
root.wm_iconbitmap(bitmap=iconfile)
else:
iconfile = pkg_resources.resource_filename(PACKAGE, 'pyDEAlogo.gif')
img = PhotoImage(file=iconfile)
root.tk.call('wm', 'iconphoto', root._w, img)
# change background color of all widgets
s = Style()
s.configure('.', background=bg_color)
# run the application
app = MainFrame(root)
root.protocol("WM_DELETE_WINDOW", (lambda: ask_quit(app)))
center_window(root,
root.winfo_screenwidth() - root.winfo_screenwidth()*0.15,
root.winfo_screenheight() - root.winfo_screenheight()*0.15)
root.mainloop()
logger.info('pyDEA exited.')
示例2: report_callback_exception
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import report_callback_exception [as 别名]
def report_callback_exception(self, *args):
"""If exception raised, don't just fail silently. Overrides."""
Tk.report_callback_exception(self, *args)
tellTerminate()