You can get and set context properties in order to define how your application will
behave within a window.
In
Screen and Windowing,
many getter and setter methods contain multiple variants, with
each variant corresponding to the type that is associated with a property. For example,
the screen_get_context_property_iv() method takes an integer, while
the screen_get_context_property_llv() takes a long long
integer.
To set context property:
-
Create a variable to pass into the function. The type must match the variant of
the function, and the value must represent a valid flag. In the example below, a
screen format flag is passed into the function.
int context_idle = 5;
-
Call the variant function. The
screen_set_context_property_iv() function takes a
reference to an integer that determines the length of time in seconds before the
window will timeout.
if (screen_set_context_property_iv(screen_context, SCREEN_PROPERTY_IDLE_TIMEOUT, &context_idle) !=0) {
return EXIT_FAILURE;
}
You can flush the context of any delayed commands by calling the
screen_flush_context() function. When you call the
screen_flush_context() function, any delayed commands are removed
from the buffer, and any associated displays are updated. If you specify the
SCREEN_WAIT_IDLE parameter, the function will not return until all
associated displays have been updated.
if (screen_flush_context(screen_context, SCREEN_WAIT_IDLE) !=0) {
return EXIT_FAILURE;
};
When debugging your application, it's a good idea to call the
screen_flush_context() function after you call any delayed
function. This will help you to determine the exact function call that caused the
error.