June 2025
Intermediate to advanced
515 pages
17h 5m
English
For event processing, VPython also provides controls such as command buttons (button), radio buttons (radio), multiple selection options (checkbox and menu), and sliders (slider).
For each event, a function must be defined to perform the relevant action. Events are always implemented according to the following schema:
control(bind=function, ...)
The control identifier can be the name of a control, such as a button, slider, checkbox, or radio button. To enable the controlelement method to trigger an event, a custom function must be passed to it as a parameter. This function is assigned to the bind property. The parentheses of the custom function must be omitted. All other parameters depend on the type of control. Listing 7.20 ...
Read now
Unlock full access