| 4 | | |
| 5 | | Callbacks (also called Events in other widget sets) are an important way to control behaviour in widget sets. |
| 6 | | |
| 7 | | First parameter is always the widget calling back, the last parameter is alway user_data that is given when registring the callback. Both are ommited below. |
| 8 | | |
| 9 | | === Existing Callbacks === |
| 10 | | * Button.on_press() |
| 11 | | * !RadioButton.on_state_change(new_state) |
| 12 | | * !CheckBox.on_state_change(new_state) |
| 13 | | |
| 14 | | === Candidates === |
| 15 | | |
| 16 | | * Widget |
| 17 | | * on_keypress(size, key) |
| 18 | | * on_mouse_event(size, event, button, x, y, focus) # finer grained? |
| 19 | | * !ListBox |
| 20 | | * on_visible_changed(top, middle, bottom) |
| 21 | | * Scrollbar |
| 22 | | * on_changed(value) |
| 23 | | * add more... |
| 24 | | |
| 25 | | |
| 26 | | == Callback interface == |
| 27 | | * register, deregister |
| 28 | | * common code for calling back |
| 29 | | * more than one callback per event? order? |
| 30 | | * callbacks return True if event is finally handled |
| 31 | | * remove/hide callback vars that currently exist (possibly breaking code) |
| 32 | | * see patch on [wiki:Development] |