CALLBACKX

CALLBACKX(widget, function, value)
Type: directive
Defines a self-defined <function> where HUG should jump to when an event for <widget> occurs, and pass <value> to that function. The arguments in the callback function should catch this value.
Example:
INCLUDE "hug.bac" 

SUB demo(NUMBER widget, NUMBER value) 
    PRINT value 
END SUB 

window = WINDOW("Hello", 200, 200) 
button = BUTTON("press here", 100, 50) 
ATTACH (window, button, 10, 10) 
CALLBACKX(button, demo, 12345) 
DISPLAY
