<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css">
<title>
Gambas Documentation - defered event
</title>
</head>
<table class="none" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<font size="-1">
<a href="../../help+en"><img class="flag" alt="Home" border="0" src="../../img/lang/en.png" align="center"></a>&nbsp;
<a href="../def+en">Up</a>&nbsp;
<a href="component+en">Previous</a>&nbsp;
<a href="dynamicarray+en">Next</a>&nbsp;
</td></tr></table>
<div class="notab">
<h1>
defered event
</h1>
A defered event is an event that is not sent immediately, but at the beginning of the next event loop.
<p>
For example, this code:
<pre class="code">...
PUBLIC SUB MyTextBox_GotFocus()
  PRINT "GotFocus"
END

PUBLIC SUB MyButton_Click()
  MyTextBox.SetFocus
  PRINT "Click"
END
...
</pre><p><p>
prints the following when you click on the button <tt>MyButton</tt>:
<pre class="code">Click
GotFocus
</pre><p><p>
The <tt>MyTextBox_GotFocus</tt> event handler is raised after the <tt>MyButton_Click</tt> has finished, when the next event loop begins.

</div>
</body>
</html>

