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

WinBinder Manual/wb create timer

bool wb_create_timer (int window, int id, int interval)

Creates a timer in the specified window. The timer must be given an integer id that must be unique to all timers and controls. interval specifies the time-out value in milliseconds. Timer events are passed to and processed by the window callback function. A call to wb_destroy_timer() destroys the timer.

Contents

Example

Clock

<?
define
("ID_APP_TIMER",  201);

$mainwin wb_create_window(NULLPopupWindowdate("h:i:s A"), 1200);
wb_set_handler($mainwin"process_main");
wb_create_timer($mainwinID_APP_TIMER1000);     // One second interval
wb_main_loop();

function 
process_main($window$id)
{
   switch(
$id) {
       case 
ID_APP_TIMER:
           
// Show the current time in hours, minutes and seconds
           
wb_set_text($windowdate("h:i:s A"));
           break;

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

Simple IRC Client

See User:M3nt0r/Simple_IRC_Client for details on using wb_create_timer with PHP sockets.

See also

Winbinder Projects