diff options
| author | Bill Spitzak <spitzak@gmail.com> | 2000-12-12 08:57:30 +0000 |
|---|---|---|
| committer | Bill Spitzak <spitzak@gmail.com> | 2000-12-12 08:57:30 +0000 |
| commit | f5375b6ab64edbe5e5b017b053fb1385613ceef9 (patch) | |
| tree | 2d8ba8726b5a04e93cd7c08c3b2651c8ab976c36 /documentation | |
| parent | 0d0b0662300a6ca9f339ec6bdbdf555dec7f26a8 (diff) | |
Fl_Gl_Window does not set drawbuffer(BACKBUFFER) for single-buffered
windows.
Fl_Input::replace(...) correctly updates the display if the replaced
region does not include the mark, point, or selected region.
Added Fl::add_check(...), Fl::remove_check, and Fl::has_check. These
are similar to idle callbacks but are only called just before it waits
for new events. They can be used to watch for changes in global state
and respond to them.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1347 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'documentation')
| -rw-r--r-- | documentation/functions.html | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/documentation/functions.html b/documentation/functions.html index d2a06357a..591f4edba 100644 --- a/documentation/functions.html +++ b/documentation/functions.html @@ -326,9 +326,39 @@ fair degree of accuracy: main() { Fl::add_timeout(1.0,callback); - for (;;) Fl::wait(); + return Fl::run(); }</PRE></UL> +<h3><A name=add_timeout>static void Fl::add_check(void (*cb)(void*),void*v=0)</A></h3> + +Fltk will call this callback just before it flushes the display and +waits for events. This is different than an idle callback because it +is only called once, then fltk calls the system and tells it not to +return until an event happens. + +<p>This can be used by code that wants to monitor the +application's state, such as to keep a display up to date. The +advantage of using a check callback is that it is called only when no +events are pending. If events are coming in quickly, whole blocks of +them will be processed before this is called once. This can save +significant time and avoid the application falling behind the events. + +<p>Sample code: + +<ul><pre>bool state_changed; // anything that changes the display turns this on + +void callback(void*) { + if (!state_changed) return; + state_changed = false; + do_expensive_calculation(); + widget->redraw(); +} + +main() { + Fl::add_check(1.0,callback); + return Fl::run(); +}</pre></ul> + <h3><A name=arg>static int Fl::arg(int argc, char **argv, int &i)</A></h3> Consume a single switch from <tt>argv</tt>, starting at word i. @@ -867,6 +897,15 @@ Returns true if the timeout exists and has not been called yet. Removes a timeout callback. It is harmless to remove a timeout callback that no longer exists. +<h3><A name=has_check>static int Fl::has_check(void (*cb)(void*), void* = 0)</A></h3> + +Returns true if the check exists and has not been called yet. + +<h3><A name=remove_check>static void Fl::remove_check(void (*cb)(void*), void* = 0)</A></h3> + +Removes a check callback. It is harmless to remove a check +callback that no longer exists. + <h3><A name=run>static Fl::run()</A></h3> As long as any windows are displayed this calls <tt>Fl::wait()</tt> |
