chickadee » libui » handler-set!

(handler-set! WIDGET TYPE PROC [ARGS ...])procedure

Sets PROC as handler for WIDGET and the event TYPE. If ARGS is specified, the given arguments will be passed to PROC when firing the handler. The following table describes the valid widget-type combinations and corresponding handlers:

Procedure signatureHandler signatureDescription
(handler-set! #f 'should-quit PROC [ARGS ...])(should-quit [ARGS ...])Fired on quit by menu item. Return #t to allow quit, otherwise #f
(handler-set WINDOW 'closing PROC [ARGS ...])(window-closing WINDOW [ARGS ...])Fired on window close. Return #t to allow window closing, otherwise #f
(handler-set BUTTON 'clicked PROC [ARGS ...])(button-clicked BUTTON [ARGS ...])Fired on button click
(handler-set SPINBOX 'changed PROC [ARGS ...])(spinbox-changed SPINBOX [ARGS ...])Fired on spinbox value changes
(handler-set SLIDER 'changed PROC [ARGS ...])(slider-changed SLIDER [ARGS ...])Fired on slider value changes
(handler-set COLOR-BUTTON 'changed PROC [ARGS ...])(color-button-changed COLOR-BUTTON [ARGS ...])Fired on color button value changes