class Fl_Poll
#include <FL/Fl_Poll.H>

This object provides the underlying time and event mechanism for FL. It is mostly a wrapper for the Unix poll() or select() call. It does not itself call X, although the X file descriptor is usually installed as one of the fd's to pay attention to. Fl_Poll may be used by itself without including any other code from FL. Fl_Poll is not provided on non-Unix implementations of FL.

extern Fl_Poll fl_poll;

There is exactly one static instance of this object. You can create more, but you must call clear() to initialize them. FL always refers to the static one.

Time is a floating-point number of seconds.

The void* argument is arbitrary user data that is passed to the callbacks.

There is a maximum of 8 of each type of callback. Adding more will silently delete some older callback. If you need more you must recompile the source.

Callbacks

void fl_poll.clear();

void fl_poll.add(int fd, short events, void (*cb)(int,void*), void* v=0);

void fl_poll.remove(int fd);

void fl_poll.add_timeout(float t,void (*cb)(void*),void* v=0);

void fl_poll.remove_timeout(void (*cb)(void*), void* v=0);

void fl_poll.add_test(int (*test)(void*), void (*cb)(void*), void* v=0);

void fl_poll.remove_test(int (*test)(void*), void (*cb)(void*), void* v=0);

void fl_poll.set_idle(void (*cb)());

Interaction

int fl_poll.wait();

float fl_poll.wait(float time);

float fl_poll.reset();

int fl_poll.check();

int fl_poll.ready();

void fl_poll.run();

(back to contents)