in reply to 2 widgets respond to same event
If more than one binding matches a particular event and they have the same tag, then the most specific binding is chosen and its callback is evaluated. The following tests are applied, in order, to determine which of several matching sequences is more specific:
- an event pattern that specifies a specific button or key is more specific than one that doesn't;
- a longer sequence (in terms of number of events matched) is more specific than a shorter sequence;
- if the modifiers specified in one pattern are a subset of the modifiers in another pattern, then the pattern with more modifiers is more specific.
- a virtual event whose physical pattern matches the sequence is less specific than the same physical pattern that is not associated with a virtual event.
- given a sequence that matches two or more virtual events, one of the virtual events will be chosen, but the order is undefined.
If the matching sequences contain more than one event, then tests (c)-(e) are applied in order from the most recent event to the least recent event in the sequences. If these tests fail to determine a winner, then the most recently registered sequence is the winner.
If there are two (or more) virtual events that are both triggered by the same sequence, and both of those virtual events are bound to the same window tag, then only one of the virtual events will be triggered, and it will be picked at random:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: 2 widgets respond to same event
by blueberryCoffee (Scribe) on Apr 21, 2005 at 03:45 UTC |