且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 wxPython 中 event.Skip() 和 event.Veto() 有什么区别?

更新时间:2023-12-04 12:00:40

Veto() 用于阻止处理事件,但 Skip() 允许传播事件和处理进一步"事件.
有两种类型的事件.基本事件和命令事件.它们的传播方式不同.事件传播是事件从子小部件到父小部件和大父小部件等的进程.基本事件不会传播.命令事件确实会传播.
此外,您可以将多个事件绑定到一个控件,默认情况下,事件处理程序中捕获的事件停止传播.要继续传播或处理其他绑定事件,请调用 Skip() 方法.我希望这个解释是清楚的.

Veto() is used to prevent processing of an event but Skip() allows propagation of events and processing of "further" events.
There are two types of events. Basic events and command events. They differ in propagation. Event propagation is the progressing of events from child widgets to parent widgets and grand parent widgets etc. Basic events do not propagate. Command events do propagate.
Also, you may bind more than one event to a control, by default, the event that is caught in a event handler stops propagating. To continue propagation or process other bound events, call the Skip() method. I hope that this explanation is clear.