当前位置:   article > 正文

Python tkinter 编程之Button_1_button-1

button-1
  1. # -*-coding:utf-8 -*-
  2. #
  3. '''
  4. 第一个Button例子
  5. Button功能触发事件
  6. command:指定事件处理函数
  7. '''
  8. from tkinter import *
  9. def hellowButton():
  10. print('hello Button')
  11. root = Tk()
  12. Button(root, text = 'Hello Button',
  13. command = hellowButton).pack()
  14. #下面的relief = FLAT设置,不指定事件处理函数,就是一个Label了!!!
  15. Button(root, text = 'hello button', relief = FLAT).pack()
  16. root.mainloop()

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/761068
推荐阅读
相关标签
  

闽ICP备14008679号