菜鸟IT的博客
"菜鸟IT"的博客 (WWW.17WX.NET)
熟悉HTML网站的前端美工到切图制作,搭配DIV+TABLE+CSS,熟悉Fireworks和Dreamwear的网站制作实战应用,专注于学习和记录JS脚本对于网页改造的各种新奇技术.平时的工作既要做销售,也要做前端开发,也要做后期的客户售后维护,此博客为博主自己平时的IT工作的实战学习笔记,记录自己工作和学习中遇到的各种坑,也分享给有需要的新人...
博客首页 网站前端制作 网赚 软件应用 Windows系统 Python
谷歌联盟提供的广告↓
[网站前端制作]有关标签↓
[网赚]有关标签↓
[软件应用]有关标签↓
[Windwos系统]有关标签↓
 | 
菜鸟IT的博客 >> Python

.bind对应鼠标事件 | tkinter.Label绑定单击事件打开超链接 link.bind("", open_url)
# 绑定label单击事件
link.bind("<Button-1>", open_url)
tkinter中的鼠标和键盘事件
一: 鼠标事件

<Button-1>                                                                     鼠标左键单击

<Button-2>                                                                     鼠标中键单击

<Button-3>                                                                     鼠标右键单击

<1> = <Button-1> =<ButtonPress-1>

<2> = <Button-2> = <ButtonPress-2>

<3> = <Button-3> =<ButtonPress-3>

 

<B1-Motion>                                                                鼠标左键拖动

<B2-Motion>                                                                鼠标中键拖动

<B3-Motion>                                                                鼠标右键拖动

 

<ButtonRelease-1>                                                    鼠标左键释放

<ButtonRelease-2>                                                    鼠标中键释放

<ButtonRelease-3>                                                    鼠标右键释放

 

<Double-Button-1>                                                    鼠标左键双击

<Double-Button-2>                                                    鼠标中键双击

<Double-Button-3>                                                    鼠标右键双击

 

<Enter>                                                                        鼠标指针进入控件

 

<Leave>                                                                      鼠标指针离开控件

 

二:键盘事件

<Return>                                                                      回车

<Cancel>                                                                     Break键

<BackSpace>                                                             BackSpace键

<Tab>                                                                          Tab键

<Shift_L>                                                                     Shift键

<Alt_L>                                                                        Alt键

<Control_L>                                                               Control键

<Pause>                                                                     Pause键

<Caps_Lock>                                                           Caps_Lock键

<Escape>                                                                   Escapel键

<Prior>                                                                        PageUp键

<Next>                                                                        PageDown键

<End>                                                                         End键

<Home>                                                                      Home键

<Left>                                                                          左箭头

<Up>                                                                           上箭头

<Right>                                                                      右箭头

<Down>                                                                    下箭头

<Print>                                                                       Print Screen键

<Insert>                                                                      Insert键

<Delete>                                                                   Delete键

<F1>                                                                           F1键

.                                                                                     .

.                                                                                     .

<F12>                                                                         F12键

<Num_Lock>                                                            Num_Lock键

<Scroll_Lock>                                                         Scroll_Lock键

<key>                                                                        任意键

 

三: 可打印的字符:

a                                                                                  字母a

b                                                                                  字母b

1                                                                                  数字1

<KeyPress-a>

<KeyRelease-a>

A                                                                                 shift+a

B                                                                                 shift+b

 

四: 组合键:

<Shift-Up>                                                                Shift+Up

<Alt-Up>                                                                    Alt+Up

<Control-Up>                                                           Ctrl+Up

<Control-A>                                                             Ctrl+shift+a

 

五:窗体事件:

<Configure>                                                           改变大小或位置

<Visibility>                                                             当组件变为可视状态时触发

<Unmap>                                                               当组件由显示状态变为隐藏状态时触发

<Map>                                                                    当组件由隐藏状态变为显示状态时触发

<Expose>                                                              当组件从原本被其他组件遮盖的状态中暴漏出来时触发

<FocusIn>                                                             组件获得焦点时触发

<FocusOut>                                                          组件失去焦点时触发

<Circulate>                                                           当窗体由于系统协议要求在堆栈中置顶或压底时触发

<Colormap>                                                         当窗体的颜色或外貌改变时触发,Tk中忽略此细则

<Property>                                                           当窗体的属性被删除或改变时触发,属于TK的核心

<Destroy>                                                            当组件被销毁时触发

<Activate>                                                            与组件选项中的state项有关,表示组件由不可用变为可用时触发

<Deactiavte>                                                       与组件选项中的state项有关,表示组件由可用变为不可用时候触发

 

六: Event

widget                                                                  事件被触发的控件

x, y                                                                        鼠标距离窗体左上角的位置(坐标)

x_root, x_y                                                          鼠标距离屏幕左上角的位置(坐标)

char                                                                      键盘事件对应的字符代码

keysym                                                                 键盘事件对应的字符串

keycode                                                               键盘事件对应的按键码

num                                                                      鼠标事件对应的按键码

width, height                                                       控件的新大小

type                                                                      事件类型

菜鸟IT博客[2022.02.09-23:23] 访问:299
[关闭窗口]  
Google公司(谷歌联盟)提供的广告↓
本页的htm伪静态链接网址:分享链接加载中....

收藏链接: www.ems-help.com | www.17post.com | www.17track.wang | www.kd100.wang | www.17wx.net | www.11185cha.com | www.sftrack.net | www.kdjiage.com | m.kdjiage.com | www.expba.net | m.expba.net | www.pptrack.net
学习Python的关键点
【1】★ Python:解决小数点后面四舍五入的精度丢失问题(二进制转换导致,另解决prec动态保留小数点后多少位)
【2】 ★ Python:单个py文件打包exe程序
【3】 ★ 给自己写的exe程序加上注册授权保护
【4】 ★ Python的http请求超时设置(timeout)| 异常类型/捕获异常
【5】 ★ Python的多线程的线程池的使用| ThreadPoolExecutor
【6】 ★ Python能用到的免费代理IP网址
【7】 ★ Python_用于测试代理IP是否有效
【8】 ★ Python Requests post() 方法 | post方式提交api
【9】 ★★★ Python Tkinter Gui视频学习教程
【10】 ★★★ Python 小项目实战-视频学习教程
【11】 ★★★ Python 爬虫项目实战-视频教程
【12】 ★★★ 高级进阶的关于python的五本书: 「Python从菜鸟到高手」、「html5+css3+JavaScript从入门到精通」、「Django Web应用开发实战」、「漫画算法」
【13】 ★★★ Request库-爬虫
【14】 ★★★ Python 图形识别文字
【15】 ★★★ Python 滑动验证码识别【图文教程】
【16】 ★★★ Python 滑动验证码识别【视频教程】
【18】 ★★★ Python 关于Class类的应用【视频教程】
【19.1】 ★★★ Python 关于进度条的制作(1)
【19.2】 ★★★ Python 关于进度条的制作(2)
【20】★★★ Python 抓取某宝的商品信息
【21】★★★ Python 一小时学会全栈开发浏览器版本的企业管理系统【视频教程】
【22】★★★ Python 全栈开发——前端+后端【视频教程】
【23】★★★ Layui 浏览器前端模块化UI框架
【24】★★★ Python-Django-Web应用开发【视频教程】
【25】★★★ Python 从0开始学【视频教程】
【26】★★★ Python的tkinter界面打包exe以后关于icon图标报错的解决办法!
【27】★★★ Python的tkinter视频学习教程【N个系统性学习合集视频】★★★
【28】★★★ Python全栈开发【视频教程】★★★
Copyright © 17WX.NET 版权所有 Manage 沪ICP备13006304号-5 沪公网安备31011702006630号
,sitemap.html,sitemap.xml
网站人气值: