wb_set_handler

int wb_set_handler (int window, string fn_handler)

Assigns the callback function fn_handler to window. The handler function is a regular PHP function that is used to process events for this particular window. wb_set_handler() must be called whenever the window needs to process messages and vents from its controls.

For additional information, see callback functions and window handlers.

Sample

$mainwin = wb_create_window(NULL, 100, "", 320, 240);
wb_set_handler($mainwin, "process_main");

// Place other initialization code here

function process_main($window, $id, $ctrl=0, $param1=0, $param2=0)
{
    switch($id) {
        case ID_ABOUT:
            wb_message_box($window, "Test application");
            break;

        case IDCLOSE:
            wb_destroy_window($window);
            break;
    }
}

See also

wb_create_window
Window functions
Callback functions and window handlers
Windows messages and events