Events


Functions

virtual int fltk::Widget::handle (int)
int fltk::Widget::send (int event)
void fltk::Widget::add_timeout (float)
void fltk::Widget::repeat_timeout (float)
void fltk::Widget::remove_timeout ()

Function Documentation

void Widget::add_timeout float  time  )  [inherited]
 

Call handle(TIMEOUT) at the given time in the future. This will happen exactly once. To make it happen repeatedly, call repeat_timeout() from inside handle(TIMEOUT).

int Widget::handle int  event  )  [virtual, inherited]
 

Handle an Events. Returns non-zero if the widget understood and used the event.

The default version returns true for fltk::ENTER and fltk::MOVE events, this is done so you can put tooltips on the base widget. All other events return zero.

Information on how to write your own version of handle() is can be found under Events.

If you want to send an event to a widget you probably want to call send(), not handle(). Send will do extra work with each event before calling this, such as turning HIGHLIGHT and FOCUSED flags on/off.

Reimplemented in fltk::Divider, fltk::Group, fltk::Window, fltk::DockWindow, fltk::ToolWindow, and fltk::WindowHolder.

void Widget::remove_timeout  )  [inherited]
 

Cancel any and all pending handle(TIMEOUT) callbacks.

void Widget::repeat_timeout float  time  )  [inherited]
 

Call handle(TIMEOUT) at the given time interval since the last timeout. This will produce much more accurate time intervals than add_timeout().

int Widget::send int  event  )  [inherited]
 

Wrapper for handle(). This should be called to send events. It does a few things:

  • It calculates event_x()/event_y() to be relative to the widget. The previous values are restored before this returns.
  • It makes sure the widget is active and/or visible if the event requres this.
  • If this is not the fltk::belowmouse() widget then it changes fltk::MOVE into fltk::ENTER and turns fltk::DND_DRAG into fltk::DND_ENTER. If this is the fltk::belowmouse() widget then the opposite conversion is done.
  • For move, focus, and push events if handle() returns true it sets the fltk::belowmouse() or fltk::focus() or fltk::pushed() widget to reflect this.


Tue Jun 27 02:19:43 2006. FLTK Dock is copyright © 2006 by MD. Z. Hossain