[tkinter从入门到放弃]-02 event

event 的属性:

widget

The widget which generated this event. This is a valid Tkinter widget instance, not a name. This attribute is set for all events.

触发事件的组件

x, y

The current mouse position, in pixels.

相对于程序的鼠标坐标

x_root, y_root

The current mouse position relative to the upper left corner of the screen, in pixels.

相对于电脑屏幕左上角的鼠标坐标

char

The character code (keyboard events only), as a string.

(键盘事件才有)按下键盘的按钮

keysym

The key symbol (keyboard events only).

(键盘事件才有)按下键盘按钮的名称

keycode

The key code (keyboard events only).

(键盘事件才有)按下键盘按钮的编号

num

The button number (mouse button events only).

(鼠标事件才有)按下鼠标的键 左中右分别为1 2 3 

width, height

The new size of the widget, in pixels (Configure events only).

(改变外形的事件才有) 新组件的长宽

type

The event type.

事件的类型


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值