Core Function DoEvents

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> DoEvents( ) </pre> === Description === Keep GUI window active by dispatching all messages in the queue. Works similar to Visual Basic 6.0's DoEvents(). === Parameters =...")
 
m (1 revision)
 
(5 intermediate revisions by one user not shown)
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
  
Keep GUI window active by dispatching all messages in the queue.
+
Keep GUI windows active by dispatching all messages in the queue.
  
 
Works similar to Visual Basic 6.0's DoEvents().
 
Works similar to Visual Basic 6.0's DoEvents().
Line 15: Line 15:
 
=== Return Value ===
 
=== Return Value ===
  
Success: Returns 1.  
+
None.
  
Failure: Returns 0 if window/control is not found.  
+
=== Remarks ===
 +
 
 +
Its worth noting the thread that created the GUI objects will need to be the one sending the DoEvents() for its objects.
  
 
=== Example ===
 
=== Example ===
  
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
Glob $GUI = GUICreate("GUI", 640, 480);
+
// Create the MDI GUI
GUISetState($GUI, @Show);
+
$GUI = GUICreate("Window", "GUI", 800, 600);
 
+
// Show the MDI GUI
// Objects
+
GUILoad( $GUI );
$obj_Test = GUICreateButton($GUI, "Test", "Test", 25, 110, 8,  8);
+
 
+
// Links
+
GUILink( $obj_button, @lClick, 'println("Clicked");' );
+
  
// Main GUI loop
+
// Keep the GUI running as long as long as the window is open
Until ( GUIState( $GUI ) == @sClosed ) DoEvents();
+
While ( GUIStatus( $GUI ) ) DoEvents( );
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Core Function]]
 
[[Category:Core Function]]

Latest revision as of 12:38, 14 June 2015

DoEvents( )

Contents

Description

Keep GUI windows active by dispatching all messages in the queue.

Works similar to Visual Basic 6.0's DoEvents().

Parameters

None

Return Value

None.

Remarks

Its worth noting the thread that created the GUI objects will need to be the one sending the DoEvents() for its objects.

Example

// Create the MDI GUI
$GUI = GUICreate("Window", "GUI", 800, 600);
// Show the MDI GUI
GUILoad( $GUI );
 
// Keep the GUI running as long as long as the window is open
While ( GUIStatus( $GUI ) ) DoEvents( );
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox