MCPcopy Index your code
hub / github.com/RustPython/RustPython / bind

Method bind

Lib/tkinter/__init__.py:1506–1545  ·  view source on GitHub ↗

Bind to this widget at event SEQUENCE a call to function FUNC. SEQUENCE is a string of concatenated event patterns. An event pattern is of the form where MODIFIER is one of Control, Mod2, M2, Shift, Mod3, M3, Lock, Mod4, M4, Bu

(self, sequence=None, func=None, add=None)

Source from the content-addressed store, hash-verified

1504 return self.tk.splitlist(self.tk.call(what))
1505
1506 def bind(self, sequence=None, func=None, add=None):
1507 """Bind to this widget at event SEQUENCE a call to function FUNC.
1508
1509 SEQUENCE is a string of concatenated event
1510 patterns. An event pattern is of the form
1511 <MODIFIER-MODIFIER-TYPE-DETAIL> where MODIFIER is one
1512 of Control, Mod2, M2, Shift, Mod3, M3, Lock, Mod4, M4,
1513 Button1, B1, Mod5, M5 Button2, B2, Meta, M, Button3,
1514 B3, Alt, Button4, B4, Double, Button5, B5 Triple,
1515 Mod1, M1. TYPE is one of Activate, Enter, Map,
1516 ButtonPress, Button, Expose, Motion, ButtonRelease
1517 FocusIn, MouseWheel, Circulate, FocusOut, Property,
1518 Colormap, Gravity Reparent, Configure, KeyPress, Key,
1519 Unmap, Deactivate, KeyRelease Visibility, Destroy,
1520 Leave and DETAIL is the button number for ButtonPress,
1521 ButtonRelease and DETAIL is the Keysym for KeyPress and
1522 KeyRelease. Examples are
1523 <Control-Button-1> for pressing Control and mouse button 1 or
1524 <Alt-A> for pressing A and the Alt key (KeyPress can be omitted).
1525 An event pattern can also be a virtual event of the form
1526 <<AString>> where AString can be arbitrary. This
1527 event can be generated by event_generate.
1528 If events are concatenated they must appear shortly
1529 after each other.
1530
1531 FUNC will be called if the event sequence occurs with an
1532 instance of Event as argument. If the return value of FUNC is
1533 "break" no further bound function is invoked.
1534
1535 An additional boolean parameter ADD specifies whether FUNC will
1536 be called additionally to the other bound function or whether
1537 it will replace the previous function.
1538
1539 Bind will return an identifier to allow deletion of the bound function with
1540 unbind without memory leak.
1541
1542 If FUNC or SEQUENCE is omitted the bound function or list
1543 of bound events are returned."""
1544
1545 return self._bind(('bind', self._w), sequence, func, add)
1546
1547 def unbind(self, sequence, funcid=None):
1548 """Unbind for this widget the event SEQUENCE.

Callers 14

__init__Method · 0.45
attachMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45
buttonboxMethod · 0.45
__init__Method · 0.45
create_unix_serverMethod · 0.45
_connect_sockMethod · 0.45
create_serverMethod · 0.45
checksigFunction · 0.45
_call_matcherMethod · 0.45

Calls 1

_bindMethod · 0.95

Tested by

no test coverage detected