pushparaj muthu wrote:

> Hi
> 
> I  want to stimulate button event . Without manually  pressing button down
> . Is there any API provided by FLTK .
> 
> How to achieve this?
> 
> Regards
> Raj

Assuming you have a variable name for the button, call do_callback(). For
example,

   ok->do_callback();

Where "ok" is a Fl_Button. This works for any widget really.

If you want to change the state of a toggle button, do:

   ok->value(1);  // Toggle on i.e. depressed
   ok->do_callback();

The important thing to note is that calling value() doesn't necessarily mean
that the callback will be called. I cannot recall if this is mentioned in
the docs or not.

-- 
Alvin
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to