Personal tools
From wiki.swiftlytilting.com
Jump to: navigation, search

WinBinder Manual/wb set handler

Syntax

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 <winterpostwiki>Callback functions and window handlers</winterpostwiki>.

Example

$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

Winbinder Projects